Write a C program to find the area of a circle by using PI as macro.

 C File =>


/* Write a C program to find the area of a circle by using PI as
macro. */


#include<stdio.h>
#define PI 3.142
int main(){
float area;
int r;
printf("\n Enter radius : ");
scanf("%d",&r);
area=PI*r*r;
printf("\n Area of circle = %f",area);
return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.