Spaces:
Running
Running
Create 13b. Print the numbers 1...16 every third number
Browse files
Week 1: Types, condition clauses and loops/13b. Print the numbers 1...16 every third number
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Arrange the lines of the program in such an order that the program prints the numbers 1...16 below in three steps.
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
public static void main(String[] args){
|
| 5 |
+
int num;
|
| 6 |
+
num = 1;
|
| 7 |
+
|
| 8 |
+
while (num < 18){
|
| 9 |
+
System.out.println(num);
|
| 10 |
+
num = num + 3;
|
| 11 |
+
}
|
| 12 |
+
}
|