-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathRepetitionFun.java
More file actions
48 lines (34 loc) · 1.07 KB
/
Copy pathRepetitionFun.java
File metadata and controls
48 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.util.Scanner;
public class RepetitionFun {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int input;
//priming read
System.out.println("Enter a non-negative integer");
System.out.println("Or negative to exit");
input = keyboard.nextInt();
while(input >= 0) {
System.out.println(input);
System.out.println("Enter a non-negative integer");
System.out.println("Or negative to exit");
input = keyboard.nextInt();
}//end while
System.out.println("Done!");
// int count = 0;
//
// while(count < 10) {
// System.out.println(count);
// count++;
// }//end while
// int count2 = 15;
//
// do {
// System.out.println(count2);
// count2++;
// }
// while(count2 < 10);
// for(int i = 0; i < 10; i++) {
// System.out.println(i);
// }//end for
}//end main
}