Share your repls and programming experiences

← Back to all posts
java program to print a number from the user
GobinathThilaga (0)

import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
int number;
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number ");
number = scan.nextInt();
System.out.print("Entered number " +number);
}
}

Output:
Enter the number 456
Entered number 456

Source: https://inlarn.com/write-a-java-program-to-print-a-number-from-the-user/