Write a program to get two numbers from user and print their sum on the screen using function.

4/21/2013 04:43:00 pm Unknown 0 Comments


Sum Through Function:

#include<stdio.h>
#include<conio.h>
int sum(int x,int y);

int main()
{
 int a,b;
 printf("enter the value of a\n");
 scanf("%d",&a);
  printf("enter the value of b\n");
 scanf("%d",&b);
 printf("the sum is %d\n",sum(a,b));
 getch();
}
int sum(int x,int y)
{
return x+y;
}