Function with arguments and no Return Value :


Note : 
  • Function accepts argument but it does not return a value back to the calling Program .
  • It is Single ( One-way) Type Communication
  • Generally Output is printed in the Called function 
  • Here area is called function and main is calling function.
Program :
#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

Bookmark & Share

Get Updates Direct in Your Mail Box


0 comments

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email