Answer to Question #211074 in C for mercy

Question #211074

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


1
Expert's answer
2021-07-05T13:28:29-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS