Question: 1 . Write a C + + program that does the following: a . Create a C + + file with the name problem 1

1.Write a C++ program that does the following:
a.Create a C++ file with the name problem1.cpp.
b.Declare two integer variables called x and y.
c.Prompt the user to enter two integer values, reading them into the variables x and y.
d.Print the following:
The sum of x and y.
y subtracted from x.
The product of x and y.
The average of x and y.
The remainder when x is divided by y.
Sample run of the program:
Enter a value for x: 5
Enter a value for y: 4
The sum of 5 and 4 is 9
4 subtracted from 5 is 1
The product of 5 and 4 is 20
The average of 5 and 4 is 4.5
The remainder when 5 is divided by 4 is 1

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!