Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago