round(0.5) - round(-0.5) का नतीजा क्या है?
What is the result of round(0.5) – round(-0.5)?
A
1.0
B
2.0
C
0(Zero)
D
0.0
Explanation
In programming languages, the round() function rounds towards the nearest even integer when the value is exactly halfway between two integers (this is known as "bankers' rounding").
So:
round(0.5)is 0 (rounded to the nearest even integer).round(-0.5)is also 0 (rounded to the nearest even integer).
Therefore:
0−0=00 - 0 = 0
So, the correct result of round(0.5) - round(-0.5) is 0.
Correct Answer: C) 0(Zero)