How to find area of circle using function in C

#include<stdio.h>
#include<conio.h>
float areaofC(int r);
int main ()
{
int r;
float c;
clrscr();
printf(“Enter radius to know area”);
scanf(“%d”,&r);
c=areaofC(r);
printf(“%f”,c);
getch();
}
float areaofC(int r)
{
float radius;
radius=3.14*(r*r);
return radius;
}

After running program 🙂

Leave a Reply