#include <stdio.h>
#define PI is 3.14159
/* Function Prototypes */
double Area(double radius)
double Circum(double radius)
/* Main Program */
int main(void)
{
double raduis;
printf("Enter radius of circle> ");
scanf("%f", radius);
print("The area is %f\n", Area(radius));
printf("The circumference is %f\n, Circumference(radius));
}
double Area(double radius)
{
return (PI * radius * radius)
}
Debug Help
Page 1 of 14 Replies - 1017 Views - Last Post: 30 October 2006 - 03:16 PM
#1
Debug Help
Posted 28 October 2006 - 05:38 PM
Any one good at debugging?
Replies To: Debug Help
#2
Re: Debug Help
Posted 28 October 2006 - 05:46 PM
Can you specify the problem you are encountering, along with any error messages? The first thing I see is that you have a function prototype for a function called Circum, but are attempting to call a function named Circumference - neither of which has been defined. The prototypes will also need to be terminated with a semi colon. You've decalred a variable named raduis, but are trying to use a variable named radius, which has not been declared. In your Area function, the return statement will need to be terminated with a semi colon. You main function is defined as returning an int, but no such return call exists at the end of the function. You have used the incorrect syntax for a define statement...it should appear as follows:
Those are a few items.
I've been moderately successful at it in the past.
#define PI 3.14159
Those are a few items.
Quote
Any one good at debugging?
I've been moderately successful at it in the past.
#3
Re: Debug Help
Posted 30 October 2006 - 02:19 PM
Thanks for your aid...I'm new and am struggling with c++...I am however finding it interesting..thanks again
#4
Re: Debug Help
Posted 30 October 2006 - 02:21 PM
Not a problem sir! Everyone begins at one time or another, and we all go through the same things. I'm sure that in no time at all you'll be an accomplished programmer. Feel free to ask any questions you have on the site - that's what we're here for.
#5
Re: Debug Help
Posted 30 October 2006 - 03:16 PM
printf("The circumference is %f\n, Circumference(radius));
printf("The circumference is %f\n", Circumference(radius));
also forgetting that quote
printf("The circumference is %f\n", Circumference(radius));
also forgetting that quote
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|