Java Program to Perform the Ceiling Operation on the Decimal Number Using the Library Method

You are currently viewing Java Program to Perform the Ceiling Operation on the Decimal Number Using the Library Method

Java program to perform the ceiling operation on the decimal number using the library method

// Java program to perform the ceiling operation on the 
// decimal number using the library method

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner X = new Scanner(System.in);

    double num = 0;

    System.out.print("Enter number: ");
    num = X.nextDouble();

    System.out.print("Number after ceiling operation: " + Math.ceil(num));
  }
}

Output

Enter number: 35.6
Number after ceiling operation: 36.0

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply