To add two numbers

#include "iostream"
using namespace std;
void main() {
int first_number, second_number, sum_of_two_number;
cout << "Enter the first integers: ";
cin >> first_number ;
cout << "Enter the second integers: " ;
     // sum of two numbers in stored in variable sum_of_two_numbers
sum_of_two_number = first_number + second_number;
     // Prints sum
cout << first_number << " + " << second_number << " = " << sum_of_two_number ;
}
Output
Enter the first integer: 2
Enter the second integer: 4
2 + 4 = 6

Post a Comment

0 Comments