C program to find area of circle, In this program we will learn how to write area of circle program in c by using the concept of concept and formula of area of circle.
Also Read: Reverse A String In C
Area of Circle Program In C
#include<stdio.h>
void main(){
const float pi = 3.14;
float r;
printf("Enter the value of radius: ");
scanf("%f",&r);
float area;
area = pi* r * r;
printf("The area of the circle is %.2f", area);
}
Area of Circle Program In C By Using Function
#include<stdio.h>
float area(float r){
const float pi = 3.14;
float area;
area = pi* r * r;
return area;
}
void main(){
float r;
printf("Enter the value of radius: ");
scanf("%f",&r);
printf("The area of the circle is %.2f", area(r));
}
That’s from this post, I hope you enjoyed it, please give your suggestion and ask your queries in the comment box.