Essay
Each of the following lines of code purport to round the results of the division of doubles to the nearest integer value (but still of type double).All are correct C++ code but some do not round correctly.Tell which rounds down,up,or to the nearest integer value,or is not reasonable
Assume that math.h has been included,and that all variables have appropriate values.
double x,y,z;
a)z = ceil(x/y);
b)z = ceil(x/y-0.5);
c)z = floor(x/y-0.5);
d)z = floor(x/y+0.5);
e)z = floor(x/y);
Correct Answer:

Verified
a)rounds up -- to the next integer great...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q1: Give an outline for the general form
Q2: Extensive use of global variables is a
Q3: ,A definition of a variable outside any
Q4: A variable declared within a function block
Q6: Write a function definition for a function
Q7: Consider two blocks,one within another.C++ prohibits an
Q8: Declare (give a prototype for)a function named
Q9: What is the error in the following
Q10: Given the function declaration (prototype),does the compiler
Q11: In C++ Boolean value are represented only