adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

program in c to find the area of circle using macro with argument

Program in C to find the area of circle using macro with argument


#include<stdio.h>
#include<conio.h>
#define AREA(x) 22.0/7.0*x*x
 int main()
  {
      float r1,r2,area;
      printf("Enter 1st radius of circle :-");
      scanf("%f",&r1);
      area=AREA(r1);
      printf("Area of circle =%.2f",area);
      printf("\nEnter 2st radius of circle :-");
      scanf("%f",&r2);
      area=AREA(r2);
      printf("Area of circle =%.2f",area);
    return 0;
  }
Output:-


Post a Comment

0 Comments