Found 1 Articles for Java Beginners

Java Program to Print an Integer

AmitDiwan
Updated on 16-Feb-2022 10:51:46

6K+ Views

In this article, we will understand how to print an integer in Java. It uses the int data type. The int data type is a 32-bit signed two's complement integer. The Minimum value is 2, 147, 483, 648 (-2^31) and the Maximum 2, 147, 483, 647(inclusive) (2^31 -1). Integer is generally used as the default data type for integral values unless there is a concern about memory. The default value is 0.InputSuppose our input isEnter an integer: 45OutputThe desired output would beThe integer is: 45AlgorithmStep 1- START Step 2- Prompt the user to enter an integer value/ define the integer ... Read More

1
Advertisements