I have been learning C programming on my own and I am just trying to get the hang of functions. And so far I seem to be missing something. Maybe just a push in the right direction.
Code:
#include <stdio.h>
#define PI 3.14
int area_Circle(int a, int r);
int main(){
float r, a;
while (printf("Enter a number to find the area of a circle,\nEnter Zero if you would like to quit!:")){
scanf("%f", &r);
if("%f", r>0)
{
printf("The area is %f\n", a);
continue;
}
else
{
"%f", r < 1;
break;
}
return 1;
}
int area_Circle(int a, int r);
{
a;
a = PI *r*r;
return a;
}
}
I though this would work this way, As I defined PI under the "#include" statement. Please help me understand what I missing here. Thanks in advance to any help.