Question: ( 1 ) Write the C + + Statements to do the following: Declare & Initialize a variable x to a value of 3 3

(1) Write the C++ Statements to do the following:
Declare & Initialize a variable x to a value of 33 and a variable y to a value of 55. Add x and y and place result variable named 'sum'. Display value in sum.
(2) Write the c++ Statements to do the following:
Declare & Initialize an integer variable x to a value of 33 and an integer variable y to a value of 55. Divide 'x' by 'y' and store the result in a double variable named 'z'. Did you get the result you were expecting? Discuss.
(3) Write the C++ Statements to do the following:
Declare & Initialize an integer variable x to, a value of 33 and an integer variable y to a value of 55.
Divide 'y' by 'x' and store the result in a double variable named 'z'. Did you get the result you were expecting?
Discuss.
(4) Using the C++ Code that you created for Execise #2, cast the variable 'x' to a type 'double' in the expression:
z=xy
Run your code in GDB Compiler.
Compare outcome of #4 with the outcome of #2.
 (1) Write the C++ Statements to do the following: Declare &

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 Databases Questions!