Computer Science, asked by purusharthsinger7, 1 year ago

Math.rint ( 14.74 ) ; ​

Answers

Answered by Mukeshgorain338
1

rint() is an inbuilt method in Java which is used to round of the floating-point argument to an integer value (in floating-point format).

Syntax

Math.rint(double n)

Program

import java.util.*;

class GFG {

 

   // Driver Code

   public static void main(String args[])

   {

       double x = 12.6;

       double y = 12.2;

 

       // rint() method use to return the  

       // closest value to the argument

       double rintx = Math.rint(x);

       double rinty = Math.rint(y);

 

       // Prints the rounded numbers

       System.out.println(rintx);

       System.out.println(rinty);

   }

}

Mark it brainlist if its helpfull to you

Similar questions