Aim:
To write a C program to find the area and circumference of the circle.
Algorithm:
Step1: Start the program
Step2: Declare the variables r, area and circumference
Step3: Read the radius of the circle
Step4: Find the area and circumference of the circle using the formula
Area = 3.14*r*r
Circumference= 2*3.14*r
Step5: print the area and circumference of the circle
Step6: Stop
Program:
#include<stdio.h>
int main() {
int rad;
float PI = 3.14, area, ci;
printf("\nEnter radius of circle: ");
scanf("%d", &rad);
area = PI * rad * rad;
printf("\nArea of circle : %f ", area);
ci = 2 * PI * rad;
printf("\nCircumference : %f ", ci);
return (0);
}
Leave a Comment