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

Program to accept and display details of 5 students (roll no, name, percentage) using structure

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