Logic for this is: Suppose x is 2.75,

for y = (int)(x+0.5)

= (int)(3.25)

which implies y to be 3,

whereas for y = (int)x+0.5

= (int)2.75+ 0.5

which implies y to be 2 because 0.5 when added to an integer implicitly 0.5 will become 0.

Rounding off x has been implemented correctly in both of the options. So both of them has to be correct.

Kindly suggest anyone if otherwise.