(Arithmetic) Write a program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum, product, difference, and quotient of the two numbers.

What will be an ideal response?


```
// Exercise 2.16 Solution: ex02_16.cpp
#include // allows program to perform input and output
using namespace std; // program uses names from the std namespace
int main()
{
int number1; // first integer read from user
int number2; // second integer read from user
cout << "Enter two integers: "; // prompt user for data
cin >> number1 >> number2; // read values from user
// output the results
cout << "The sum is " << number1 + number2
<< "\nThe product is " << number1 * number2
<< "\nThe difference is " << number1 - number2
<< "\nThe quotient is " << number1 / number2 << endl;
} // end main
```

Computer Science & Information Technology

You might also like to view...

Which of the following statements is false?

a. With external iteration you specify all the iteration details. b. Every time you write code that modifies a variable, it’s possible to introduce an error into your code. c. Letting the library determine how to iterate over a collection of elements is known as internal iteration. d. All of the above are true.

Computer Science & Information Technology

In a database, a(n) ________ is a vertical column that stores information that describes a record

A) field B) item C) array D) table

Computer Science & Information Technology

The capitalization for a complimentary close with two words is illustrated correctly in the following example: Sincerely yours

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

In a knowledge management system, a knowledge base consists of logical rules that identify data patterns and relationships.?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology