Statement of C program: Enter the radius of a circle and prints its
- Area
- Perimeter
1. Area of Circle:
#include<stdio.h>
#include<conio.h>
void main()
{
float radius , area;
float PI=3.142 ;
clrscr();
scanf("%f" , &radius);
area= PI * radius * radius ;
printf(" Area of circle=%f\n " , area);
printf(" Perimeter=%f\n" , pmeter);
getch();
}
Output:
Enter the radius
7
Area of circle= 154 44 44
2. Perimeter of Circle:
#include<stdio.h>
#include<conio.h>
void main()
{
float radius , pmeter; // pmeter stands for perameter of circle.
float PI=3.142 ;
clrscr();
printf(" Enter the radius\n");
scanf("%f" , &radius);
pmeter = 2* PI * radius;
printf(" Area of circle=%f\n " , area);
printf(" Perimeter=%f\n" , pmeter);
getch();
}
Output:
Enter the radius
7
Perimeter of circle= 4444
0 Response to "C Program: Enter the Radius of circle and Find out its Area and Perimeter"
Post a Comment