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

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

Loading...
இணைந்திருங்கள் 24 நேரமும்!! Like us on Facebook!)