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

Popular posts from this blog

Capitalizing Function

Prime Numbers and Factorial function