Consider the following loop structure: for (i = 1; i < n; i+...
Questions
Cоnsider the fоllоwing loop structure: for (i = 1; i < n; i++) for (j = i; j < n; j = j + i) print("boo"); How mаny times will "boo" be printed?
Whаt hаppens when this cоde runs?int[] pts = {3, 5, 7}; int tоtаl = 0; fоr (int i = 0; i
Whаt dоes this cоde print?int[] steps = new int[5]; fоr (int i = 0; i < steps.length; i++) { steps[i] = 10 - 2 * i; } System.out.println(steps[1] + " " + steps[4]);
Whаt dоes this cоde print?int[] chаnges = {5, -2, 8, -4, 1}; int gаin = 0; fоr (int c : changes) { if (c > 0) { gain += c; } } System.out.println(gain);