Tuesday, 10 January 2017

and two number code c++


 

Solution In C ++: Solution In C++:

 

 #include <iostream> #include<iostream>

using namespace std; using namespace std ;

 

 

 

 int main () {

 int A, B, C; int A , B , C ;

 

    cout << "Enter first number:" << endl ;; cout << "Enter first number:" << endl ;;

 

    cin >> A; cin >> A ; // Read first number

 

    cout << "Enter second number:" << endl ;; cout << "Enter second number:" << endl ;;

 

    cin >> B; cin >> B ;

// Read second number

    C = A + B; C = A + B ;

 

    cout << "Sum of" << A << "and" << B << "=" << C << endl; cout << "Sum of " << A << " and " << B << " = " << C << endl ;

 

    return 0; return 0 ;

} }


output
Enter first number:10
Enter second number:15
Sum of 10 and 15 = 25