Answers for "take input integer in java"

1

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); 
  }
}
Posted by: Guest on October-21-2021
3

read integer input java

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(br.readLine());
Posted by: Guest on February-20-2020

Code answers related to "take input integer in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language