import java.util.Scanner;
public class Rounded{
public static void main(String []args){
Scanner in = new Scanner(System.in);
System.out.print("Input a decimal number: ");
double decimal = in.nextDouble();
long rounded = Math.round(decimal);
System.out.println("Rounded to nearest ingeter: " + rounded);
in.close();
}
}
Comments
Leave a comment