I came to know that the correct way to round off a floating number x to an integer value is
y = (int) (x + 0.5)
I couldn't understand. Why is the fraction 0.5 (and not anything else) added to x?
Moreover, what actually the prefix (int) is doing here?
