Java program to print Small Integer, Largest Integer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Write a program that will read a float type value from the keyboard and print
   the following output.
   ->Small Integer not less than the number.
   ->Given Number.
   ->Largest Integer not greater than the number.
 */
class ValueFormat{
	public static void main(String args[]){
		double i = 34.32; //given number
		System.out.println("Small Integer not greater than the number : "+Math.ceil(i));
		System.out.println("Given Number : "+i);
		System.out.println("Largest Integer not greater than the number : "+Math.floor(i));
	}
}
surajk

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in