for(int i = 0; i < 10; i = i * 2) {
System.out.println("The answer is " + i); } |
1
0.1 0.01 0.001 0.0001 0.00001 0.000001 0.0000001 |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 0 | 1 | -5 | 23 | 34 | 4 | 5 | 6 | 7 | 8 | 9 |
class ER {
public static void main(String args[]) { int data[] = new int[1000]; data[1] = 3; data[2] = 1; data[3] = 5; int i = 1; while (data[i] != 5) { i = data[i]; System.out.println("Data was " + i); } } } |