0 votes
in JAVA by
How to round off numbers in java?

1 Answer

0 votes
by
"import java.lang.Math; // Needed to use Math.round()

class Program {

    public static void main( String args[] ) {

      double num1 = 74.65;

      System.out.println(Math.round(num1));

      float num2 = 1337.345523f;

      System.out.println(Math.round(num2));

    }

}"

Related questions

0 votes
asked Oct 23, 2020 in JAVA by rahuljain1
0 votes
asked May 21, 2020 in JAVA by GeorgeBell
...