Sum of two integers using functions
#include <iostream>
using namespace std;
int Sum(int p, int q) // Function declare
{
int ans= p+q; //Function define
return ans;
}
int main()
{
int a,b;
cout<<"Put any two numbers:\n";
cin>>a>>b;
cout<<"The sum is:- "<<Sum(a,b);
}
Comments
Post a Comment