Ticker

6/recent/ticker-posts

C program to find area of circle using user defined function

#include<stdio.h>

#define pi 3.14

float area(float);

void main(){

float r,a;

printf("enter the radius of circle in cm: ");

scanf("%f",&r);

a=area(r);

printf("the area of circle is %.2f sq cm",a);

}

float area(float radii){

float ac;

ac = pi*radii*radii;

return ac;

}



Reactions

Post a Comment

0 Comments