Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner input = new Scanner (System.in);
- System.out.println ("how many number you want to put in the array?");
- int num = input.nextInt();
- int numbers[] = new int[num];
- for (int i = 0; i < num -1 ; i++) {
- System.out.println ("number" + i + ":");
- numbers[i] = input.nextInt();
- }
- for (int l : numbers){
- System.out.println(l);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement