Computer Applications
double b = -15.6;
double a = Math.rint(Math.abs(b));
System.out.println("a = " + a);
Related Questions
The AMB hotel gives the amount to be paid by the customer as an integer, which of the following Math method rounds off the bill in decimals to an integer?
- Math.round()
- Math.pow()
- Math.ceil()
- Math.abs()
Which of the following mathematical methods returns only an integer?
- Math.ceil(n)
- Math.sqrt(n)
- Math.floor(n)
- Math.round(n)