CP CVDT Q56

  • Option : A
  • Explanation : The expression (float)9/5 first converts the integer 9 into the floating-point value 9.0. Since one operand is floating-point, 5 is also converted to float and floating-point division is performed. Therefore, 9.0/5.0 produces 1.8. The printf format specifier %f displays this value as 1.800000 by default. Hence, option A (1.8) is the intended correct answer.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *