DamnSchool

Function with arguments and with return value.

The data is transferred between the calling function and called function. i.e., The called program receives some data from the calling program and send back a value return to the calling program.

Syntax

#include<stdio.h>
int add();
void main()
{
int a=5,b=5,c;
c=add(a,b);
printf("sum is %d",c);
}
int add(int x, int y)
{
int z;
z=x+y;
return(z);
}

Run Example >

< Previous Next >

Privacy Policy Terms of Service About
Creative Commons License
This work is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International License.