Java Program to Round of the Float value and return it in Integer in Java

Java Program to Round of the Float value and return it in Integer in Java

 

 Code:

import java.util.*;
public class RoundOfTheValue {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
float data = sc.nextFloat();
System.out.println(Math.round(data));
}
}

 Sample Input/Output:

 

Comments

Popular posts from this blog

Java Releases - Summary

Flutter: Simple Flutter Navigation app UI