Practice Program
void main()
{
float r,Area;
//Area of circle = 3.14*radius*radius
printf("Enter the radius of circle:");
scanf("%f",&r);
Area = 3.14*(r*r);
printf("\nArea of circle is %f",Area);
}
void main() { float r,Area; //Area of circle = 3.14*radius*radius printf("Enter the radius of circle:"); scanf("%f",&r); Area = 3.14*(r*r); printf("\nArea of circle is %f",Area); }
Output1
Enter radius of the circle:1.2
Area of the circle is 4.521600.
Area of the circle is 4.521600.
Output2
Enter radius of the circle:2
Area of the circle is 12.560000.
Area of the circle is 12.560000.
Output3
Enter radius of the circle:4.6
Area of the circle is 66.442398.
Area of the circle is 66.442398.
0 Comments
Post a Comment