C Program To Find Area and Circumference of Circle
In this article, we are going to write a C Program To Find Area of Circle and Circumference
We will make this program in the following way -:
- C Program To Find Area and Circumference of Circle (Simple Way)
- C Program To Find Area and Circumference of Circle Using Function
- C Program To Find Area and Circumference of Circle Using Pointer
To make this program, we will use the following concept given below.
If you do not know about these topics well, then you may not understand this program, so you should know about them in detail from the link given above.
Now without wasting time let’s start programming.
C Program To Find Area and Circumference of Circle
Algorithm
- Program Start
- Declare Variables
- Input Radius From the User
- Calculate Area of Circle
- Calculate Circumference of circle
- Print area of circle
- Print circumference of circle
- Program End
Program
#include<stdio.h>
void main()
{
float r,aoc, coc ;
printf("Enter the radius : ");
scanf("%f",&r);
aoc=3.14*(r*r);
coc = 2*3.14*r;
printf("Area of Circle is : %f",aoc);
printf("\nCircumference of Circle is : %f",coc);
}
Output
Enter the radius : 4
Area of Circle is : 50.240002
Circumference of Circle is : 25.120001
C Program To Find Area and Circumference of Circle Using Function
Algorithm
- Program Start
- Declare Variables
- Input Radius From the User
- Calling Function to find area of circle
- Calculate Area of Circle
- Print Area of circle
- Calling Function to find circumference of circle
- Calculate Circumference of circle
- Print circumference of circle
- Program End
Program
#include<stdio.h>
void aoc(float r)
{
float area;
area = 3.14*(r*r);
printf("Area of Circle is : %f",area);
}
void coc(float r)
{
float area;
area =2*3.14*r;
printf("\nCircumference of Circle is : %f",area);
}
void main()
{
float r;
printf("Enter the radius : ");
scanf("%f",&r);
aoc(r);
coc(r);
}
Output
Enter the radius : 6
Area of Circle is : 113.040001
Circumference of Circle is : 37.680000
C Program To Find Area and Circumference of Circle Using Pointer
Program
#include<stdio.h>
void aoc(float *r)
{
float area;
//here r is a pointer variable
area = 3.14*(*r)*(*r);
printf("Area of Circle is : %f",area);
}
void coc(float *r)
{
float area;
//here r is a pointer variable
area =2*3.14*(*r);
printf("\nCircumference of Circle is : %f",area);
}
void main()
{
float r;
printf("Enter the radius : ");
scanf("%f",&r);
aoc(&r);
coc(&r);
}
Output
Enter the radius : 3
Area of Circle is : 28.260000
Circumference of Circle is : 18.840000
Read More
- Download C Language Notes Pdf
- C Language Tutorial For Beginners
- C Programming Examples With Output
- 250+ C Programs for Practice PDF Free Download
Conclusion
So friends, in this article, we have written a C Program To Find Area and Circumference of Circle this ways -:
- C Program To Find Area and Circumference of Circle (Simple Way)
- C Program To Find Area and Circumference of Circle Using Function
- C Program To Find Area and Circumference of Circle Using Pointer
If you have difficulty to understand any program or have any doubts or questions, then tell me in the comment below.
Bro also add python solutions to the questions..
Plzzz
My request is provide python solutions
ok