Google Search

Saturday, October 24, 2015

C program example of "Function with no arguments and no return value."

‪#‎include‬<stdio.h>
void area(); // Prototype Declaration
void main()
{
area();
}
void area()
{
float area_circle;
float rad;
printf("\nEnter the radius : ");
scanf("%f",&rad);
area_circle = 3.14 * rad * rad ;
printf("Area of Circle = %f",area_circle);
}
Output:
Enter the radius : 3
Area of Circle = 28.260000

No comments:

Post a Comment