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
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q1: Of what value are comments that accompany
Q2: Consider two blocks,one within another.C++ prohibits an
Q3: Define a function named average_grade.This function returns
Q5: A variable declared within a function block
Q6: A variable declared outside any function is
Q7: What is the error in the following
Q8: Calling something a black box is a
Q9: It is legal to replace the prototype
double
Q10: A sequence of calls to the library
Q11: Consider two blocks,one within another.If an identifier
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents