C programs with algorithm, flowchart and pseudo code for Computer Practice I (185151) for First Semester Anna university
10:16 PM
Posted by Vinoth
Program to find area and circumference of the circle:
Program to find area and circumference of a circle
CODING:
#include
#include
int main()
{
float radius, area, circum;
clrscr();
printf("Enter radius: ");
scanf("%f", &radius);
area = radius * radius * 22 / 7; /* pr² */
circum = 2 * radius * 22 / 7; /* 2pr */
printf("Area = %f\nCircumference = %f\n", area, circum);
getch();
return 0;
}
#include
int main()
{
float radius, area, circum;
clrscr();
printf("Enter radius: ");
scanf("%f", &radius);
area = radius * radius * 22 / 7; /* pr² */
circum = 2 * radius * 22 / 7; /* 2pr */
printf("Area = %f\nCircumference = %f\n", area, circum);
getch();
return 0;
}
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
. Follow any responses to this post through RSS. You can leave a response, or trackback from your own site.
Subscribe to:
Post Comments (Atom)
Search Here
Custom Search
Post a Comment