75. WRITE A C PROGRAM FUNCTION WITH ARGUMENTS AND NO RETURN VALUE

/* C program Function with arguments and no Return Value */

#include<stdio.h>
#include<conio.h>
//----------------------------------------
void area(float rad); // Prototype Declaration
//----------------------------------------
void main()
{
float rad;
printf("nEnter the radius : ");
scanf("%f",&rad);
area(rad);
getch();
}
//----------------------------------------
void area(float rad)
{
float ar;
ar = 3.14 * rad * rad ;
printf("Area of Circle = %f",ar);
}

output

Enter the radius : 3
Area of Circle = 28.260000

Comments