Saturday, 20 May 2017

C++ program to add two integer numbers using function Problem Solution.


Solution:

#include<bits/stdc++.h>
using namespace std;
/*
    * Prosen Ghosh
    * American International University - Bangladesh (AIUB)
    *
*/
int addition(int a,int b);
int main(){

    int a,b,sum;
    cout << "Enter first number: ";
    cin >> a;
    cout << "Enter second number: ";
    cin >> b;
 
    sum = addition(a , b);
    cout << "Addition is: " << sum << endl;
    return 0;
}

int addition(int a,int b){
    return (a + b);
}

No comments:

Post a Comment