Write a program to add two integer with the help of prototyping and saving in CPP extension.

#include
#include
main()
{
int a,b,c;
int sum(int,int);
clrscr();
printf(“nEnter the first number:”);
scanf(“%d”,&a);

printf(“nEnter the second number:”);
scanf(“%d”,b);

c=sum(a,b);
printf(“n Addition of “<<a<<" and "<<b<<" is : "<<c;
getch();
}
int sum(int x,int y)
{
int z;
z=x+y;
return(z);
}

Leave a reply