Question #211074

Write a C program to find the area of circle using preprocessor directives.


Expert's answer

#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS