C program, algorithm, flowchart & explanation to calculate the area and circumference of a circle.

C program to calculate the area and circumference of a circle

Write a C program to calculate the area and circumference of a circle:-

Here, we have to write a simple C program that takes a radius value by the user and gives circumference and area values as output.

Formulae used:-

Area= Pi*radius*radius

Circumference= 2*Pi*radius

Explanation & Program code:-

We will ask the user to enter the value of the radius, then we will store the entered value in a variable. Based on the entered radius value, we will calculate the area and circumference of the circle. To make the program code easier we have taken the standard Pi value as 3.14, you can also take the Pi value as 22/7 for a more accurate result. Further details are mentioned as comments in the program code.

Output:-

Algorithm of program to calculate the area and circumference of a circle:-

Step 1:- Start.
Step 2:- Declaration of variables.
Step 3:- Read the radius of the circle.
Step 4:- Circumferance=2*𝝅*r.
Step 5:- Print circumference.
Step 6:- Area=3.14*r*r.
Step 7:- Print area.
Step 8:- Stop.

Flowchart of the program to calculate the area and circumference of a circle:-

Flowchart to calculate the area and circumference of a circle.

As you have reached the end of the article, so I hope as of now you have a clear understanding of the program, algorithm, and flowchart to calculate the area and circumference of a circle. Please let me know your queries, suggestion, and feedback in the comment section.

Leave a Comment

Your email address will not be published. Required fields are marked *