Question: Write a program in C++ that accepts the values of two variables num1 and num2 from the user and Add them and store the result

Write a program in C++ that accepts the values of two variables num1 and num2 from the user and

  1. Add them and store the result in a third variable sum.
  2. Subtract them and store the result in a fourth variable difference.
  3. Multiply them and store the result in a fifth variable product.

Display the output of this program in the following format:

Sum of ____________ and ____________ is _______________.

Difference of ____________ and ____________ is ____________.

Product of ____________ and ____________ is ______________.

These dashes will have the values of num1, num2, sum, difference and product respectively.

Step by Step Solution

3.42 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solu... View full answer

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!