Question: include using namespace std; int main ( ) { int a , b; cout < < Calculator ; cout < < Let's add,

include
using namespace std;
int main(){
int a, b;
cout << "Calculator
";
cout <<"
Let's add, subtract, multiply, and divide 2 numbers.
";
// Taking input from the user
cout << "Insert the first number: ";
cin >> a;
cout << "Insert the second number: ";
cin >> b;
// Performing calculations and displaying the results
cout <<"
The calculations are:
";
cout <<"A + B ="<<(a + b)<< endl;
cout <<"A - B ="<<(a - b)<< endl;
cout <<"A * B ="<<(a * b)<< endl;
if (b !=0){
cout <<"A / B ="<<(a / b)<< endl;
cout <<"A % B ="<<(a % b)<< endl;
} else {
cout << "Division and modulus by zero are undefined.
";
}
return 0;
}
please the program code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!