Teaching Rajasthan Basic Computer Instructor 2021 Mock Test Programming and Data Structure Programming in C
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)