Write a C program to find the area of circle using preprocessor directives.
#include <stdio.h>
#define AREA_OF_CIRCLE(r) ((r)*(r)*3.1415926)
int main()
{
double r = 5.0;
printf("Radius of circle is %f\n", r);
printf("Area of circle is %f\n", AREA_OF_CIRCLE(r));
return 0;
}
Comments
Leave a comment