Here the code is used to get or display the area and perimeter of a circle. You can change the formula
for your required object .
C Code:
#include<stdio.h>
#include<conio.h>
void main()
{float r,area,peri;//(float examples 3.14,2.19,9.999.)
printf("\t\t\tFind the Perimeter and area of a circle");
printf("\n\nEnter the radius of the Circle ");
scanf("%f",&r);
area=3.14*r*r;
peri=2*3.14*r;//We take the value of pi as 3.14.
printf("\nThe Area of the Circle is %f",area);
printf("\nThe Perimeter of the Circle is %f",peri);
getch();
}
Output :
Here Code blocks & gcc compiler is used for the programming.
for your required object .
C Code:
#include<stdio.h>
#include<conio.h>
void main()
{float r,area,peri;//(float examples 3.14,2.19,9.999.)
printf("\t\t\tFind the Perimeter and area of a circle");
printf("\n\nEnter the radius of the Circle ");
scanf("%f",&r);
area=3.14*r*r;
peri=2*3.14*r;//We take the value of pi as 3.14.
printf("\nThe Area of the Circle is %f",area);
printf("\nThe Perimeter of the Circle is %f",peri);
getch();
}
Output :
Here Code blocks & gcc compiler is used for the programming.
No comments:
Post a Comment