Write a
program to find the sum of two numbers using function:
#include<stdio.h>
#include<conio.h>
int sum(int a,
int b)
{
int c;
c=a+b;
return(c);
}
int main()
{
int x, y, z;
printf("Enter
the two numbers");
scanf("%d
%d",&x,&y);
z=sum(x,y);
printf("Sum
of %d + %d is %d",x,y,z);
getch();
return(0);
}
Output:
Enter the
two numbers
4 4
Sum of 4 + 4 is 8
No comments:
Post a Comment