Write a program to add two number using cpp with return type.
#include<iostream.>
using namespace std;
int add(int ,int);
int main()
{
int a,b;
cout<<"enter two number ";
cin>>a>>b;
cout<<"sum is "<<add(a,b);
}
int add(int x,int y)
{
return(x+y);
}
out put
#include<iostream.>
using namespace std;
int add(int ,int);
int main()
{
int a,b;
cout<<"enter two number ";
cin>>a>>b;
cout<<"sum is "<<add(a,b);
}
int add(int x,int y)
{
return(x+y);
}
out put
No comments:
Post a Comment