Question: Suppose x1 and x2 are two type double variables that you want to add as integers and assign to an integer variable. Construct a C++

Suppose x1 and x2 are two type double variables that you want to add as integers and assign to an integer variable. Construct a C++ statement for doing so. What if you want to add them as type double and then convert to int?

Step by Step Solution

3.38 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer and Explanation int x1 2 int x2 3 int sum1 x1 x2 double sum2 staticcast x1 ... 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 Introduction Java Program Questions!