CP CVDT Q51

  • Option : A
  • Explanation : For a nonnegative floating-point value, the expression (int)(x + 0.5) is a traditional way to round to the nearest integer by adding 0.5 and then truncating the fractional part. This approach is not generally correct for negative values. The standard math library provides round() and lround() for more general rounding.
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 *