What does it mean by user defined function and give the example program to demonstrate function.

User Defined Functions

The functions which are created by user for program.

Syntax:
void main()
{
       // Function prototype
       ([]);
 
       // Function Call
       ([<arguments>]);
}
// Function definition
([]);
{
       ;
}
 
Program to demonstrate function
#include <stdio h>
#include <conio h>
void add()
{
       int a, b, c;
       clrscr();
       printf("\n Enter Any 2 Numbers : ");
       scanf("%d %d",&amp;a,&amp;b);
       c = a + b;
       printf("\n Addition is : %d",c);
}
void main()
{
       void add();
       add();
       getch();
}


0 Comment "What does it mean by user defined function and give the example program to demonstrate function."

Post a Comment