Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

inputing number in java

import java.util.*;
class InputNum {
  
  public static void main(String args[]) {
  Scanner sc = new Scanner(System.in);
    
    System.out.print("Enter a number: "); // will ask the user to input number
    int enter = sc.nextInt(); // stores the number input
    
    // print the value by calling enter variable
    System.out.println(enter); 
  }
}
 
PREVIOUS NEXT
Tagged: #inputing #number #java
ADD COMMENT
Topic
Name
2+1 =