The following code appears to have a number of bugs in it that I would have assumed would produce compilation errors. In particular the bracing of the circle function, and incorrect prototyping. What does the compiler think is going on and why does it think it is acceptable?
#include <stdio.h>
#include <math.h>
double circle ();
int main(void)
{
double r;
double a;
printf("Please enter a radius value: ");
scanf("%lf", &r);
a = circle(a, r);
printf("%lf\n", a);
}
double circle(a, r)
double a, r;
{
a = M_PI*(r*r);
return a;
}