Addition Of Number Using Function - C Program

Addition Of Number Using Function

#include <stdio.h>
int add(int a,int b); //function prototype
void main()
{
	int x,y,z;
	printf("Enter the value of x and y :");
	scanf("%d%d",&x,&y);
	z=add(x,y); //function calling
	printf("Addition of x and y is : %d",z);
}
//function defination
int add(int a,int b)
{
	int c;
	c=a+b;
	return c;
}

Output - Addition Of Number Using Function

Enter the value of x and y :10 20  
Addition of x and y is : 30 
Compile and Run Online