The correct way to round off a non-negative floating number x to an integer…

PYQ UGC NET 2013Modified — slightly modified from the official paper; see the solution

The correct way to round off a non-negative floating number x to an integer value is

  1. A.

    y = (int) (x + 0.5)

  2. B.

    y = int (x + 0.5)

  3. C.

    y = (int) x + 0.5

  4. D.

    y = (int) ((int)x + 0.5)

Attempted by 1356 students.

Sign up free to check your answer

Sign up free

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…