write a program that input two numbers and add them using a function
#include<iostream>
#include<conio.h>
using namespace std;
int sum(int x,int y)
{
return(x+y);
}
main()
{ int a,b;
cout<<"Enter two numbers to add"<<endl;
cin>>a>>b;
int res1=sum(a,b);
cout<<"Sum is "<<res1;
getch();
}
No comments:
Post a Comment