Q:

Write a program in C++ to add two numbers accept through keyboard

0

Write a program in C++ to add two numbers accept through keyboard

Sample Output:

 Sum of two numbers :                                                  
-------------------------                                              
 Input 1st number : 25                                                 
 Input 2nd number : 39                                                 
 The sum of the numbers is : 64

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
using namespace std;
 
int main()
{
	int num1, num2, sum;
    cout << "\n Sum of two numbers :\n";
	cout << "-------------------------\n";   
	cout << " Input 1st number : ";
	cin >> num1 ;
	cout << " Input 2nd number : ";
	cin >> num2;
	sum = num1 + num2;
	cout <<" The sum of the numbers is : " << sum << endl;
	cout << endl;
	return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now