What is the correct way to round off y, a float, to an int value?

1
y = (int) (x + 0.5)
2
y = int (x + 0.5)
3
y = (int) x + 0.5
4
y = (int) ((int) x + 0.5)

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation