Calculate area, circumference & radius of circle in C language.

Let’s understand some concept.

In this programme, calculate the area, circumference & radius of the circle by using mathematical formula. Area =pie*r*r, The circumference =2*pie*r. Other are made by this. Here is so simple concept..

Calculate the area of circle by entering the radius of circle

Some important symbols used in code.

  • () small bracket
  • && use for ‘and’ use for address
  • {} curly bracket
  • “” double code
  1. #include<studio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. float pie=3.14, r, area;
  6. clrscr();
  7. printf(“Enter the radius of circle to calculate the area”);
  8. scanf(“%f”, &r);
  9. area=pie*(r*r);
  10. printf(“area of the circle = %f”, area);
  11. getch();
  12. }

Inputs..

If r= 50 then

Results..

Calculate the radius by entering the area of the circle.

  • #include<studio.h>
  • #include<math.h>
  • int main()
  • {
  • float pie=3.14,r,area,radius;
  • printf(“Enter the Area of circle”);
  • scanf(“%f”, &area);
  • r=area/pie;
  • radius=sqrt(r);
  • printf(“radius Of the circle =%f”, radius);
  • return 0;
  • }

Inputs..

If area =123

Results..

Calculate the circumference of circle by entering the radius of circle

  1. #include<studio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. float pie=3.14, r, circum;
  6. clrscr();
  7. printf(“Enter the radius of circle to calculate the circumference of the circle”);
  8. scanf(“%f”, &r);
  9. circum=2*pie*r;
  10. printf(“circumference of the circle = %f”, circum);
  11. getch();
  12. }

Inputs..

If r=50 then

Results..

Calculate the radius by entering the circumference of the circle.

  1. #include<studio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. float pie=3.14, r, circum;
  6. clrscr();
  7. printf(“Enter the circumference of circle to calculate the radius of the circle”);
  8. scanf(“%f”, &circum);
  9. r=circum/2*pie;
  10. printf(“radius of the circle = %f”, radius);
  11. getch();
  12. }

Inputs..

If circum =314 then

Results..

Radius = 50

One Reply to “”

Leave a comment

Design a site like this with WordPress.com
Get started