#include<stdio.h>
void main()
{
float r,aoc;
printf("Enter the radius : ");
scanf("%f",&r);
aoc=3.14*(r*r);
printf("area of circle is : %f",aoc);
}
Output
Enter the radius : 5
area of circle is : 78.500000
C Program To Find Area of Circle Using Function
Algorithm
Program Start
Declare Variables
Input Radius From User
Calling Function To Calculate Area of Circle
Calculating Area of Circle
Display Result
Program End
Program
#include<stdio.h>
void areaofCircle(float r)
{
float aoc;
aoc=3.14*(r*r);
printf("area of circle is : %f",aoc);
}
void main()
{
float r;
printf("Enter the radius : ");
scanf("%f",&r);
areaofCircle(r);
}
Output
Enter the radius : 7
area of circle is : 153.860001
C Program To Find Area of Circle Using Pointer
Program
#include<stdio.h>
void areaofCircle(float *r, float *aoc)
{
*aoc=((3.14)*(*r)*(*r));
}
void main()
{
float r, aoc;
printf("Enter the radius : ");
scanf("%f",&r);
areaofCircle(&r,&aoc);
printf("area of circle is : %f",aoc);
}
Output
Enter the radius : 3
area of circle is : 28.260000
C Program To Find Area of Circle Using Micro or #Define
Program
//C Program To Find Area of Circle Using Micro or #Define
#include<stdio.h>
#define pi 3.14
void areaofCircle(float r)
{
float aoc;
aoc=pi*(r*r);
printf("area of circle is : %f",aoc);
}
void main()
{
float r;
printf("Enter the radius : ");
scanf("%f",&r);
areaofCircle(r);
}
Output
Enter the radius : 10
area of circle is : 314.000000
C Program To Find Area of Circle (Simple Way)
Algorithm
Program
Output
C Program To Find Area of Circle Using Function
Algorithm
Program
Output
C Program To Find Area of Circle Using Pointer
Program
Output
C Program To Find Area of Circle Using Micro or #Define
Program
Output
need an explanation for this answer? contact us directly to get an explanation for this answer