C Program to Calculate Area of Circle

 


C Program to Calculate Area of Circle




/*********************************************************************
C Program to calculate area of circle
area=pi*r*r
********************************************************************/
#include<stdio.h>
#include<conio.h>
void main()
{
float pi=3.14;
float r=3.5;
float area;

clrscr();
area=pi*r*r;
printf("The area of circle is:\t%f\n",area);
printf("End of program");
}


The area of circle is: 38.465004

End of program



/*********************************************************************
C Program to calculate area of circle
area=pi*r*r
********************************************************************/
#include<stdio.h>
#include<conio.h>
void main()
{
float r,area;
float pi=3.14;

clrscr();
printf("Enter radius to calculate area of circle\n");
scanf("%f",&r);
area=pi*r*r;
printf("The area of circle is:\t%f\n",area);
printf("End of program");
}


Enter radius to calculate area of circle

2

The area of circle is: 12.560000

End of program




/*********************************************************************
C Program to calculate area of circle
area=pi*r*r
********************************************************************/
#include<stdio.h>
#include<conio.h>
void main()
{
float r,area;
float pi=3.14;

clrscr();

printf("Enter radius to calculate area of circle\n");
scanf("%f",&r);
printf("The area of circle is:\t%f\n",
pi*r*r);
printf("End of program");
}


Enter radius to calculate area of circle

2

The area of circle is: 12.560000

End of program





टिप्पणी पोस्ट करा

0 टिप्पण्या