Advertisement
mmayoub

School11, 170910, Ex01

Sep 10th, 2017
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. package myPkg;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Ex01 {
  6.  
  7.     public static void main(String[] args) {
  8.         int x;
  9.  
  10.         Scanner in = new Scanner(System.in);
  11.         System.out.println("Enter a number: ");
  12.         x = in.nextInt();
  13.         x = x * 2;
  14.         System.out.println("the result is: " +x);
  15.        
  16.         in.close();
  17.         }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement