Java Program to Print an Integer (Entered by the User)

In this program, you'll learn to print a number entered by the user in Java. The integer is stored in a variable using System.in, and is displayed on the screen using System.out.

Example: How to Print an Integer entered by an user



When you run the program, the output will be:

Enter a number: 12
You entered: 12

Post a Comment

Thank you for vising

Previous Post Next Post