1.
- 50
- 0
- 5
- 270
- 275
Q6: What is the value of
total
after the execution of the folowing code?int total = 0;
for (int x = 50; x >= 0; x = x - 5) {
total += x;
}
total
after the execution of the folowing code?int total = 0;
for (int x = 50; x >= 0; x = x - 5) {
total += x;
}
for (int y = 0; y < 10; y++) {
System.out.print(y * y + " ");
}
for (int y = 100; y < 10; y--) {
System.out.println(y);
}
a
and b
after the folowing code executes?int a = 0, b = 0;
for (int x = 1; x <= 15; x++) {
if (x % 2 == 0)
a += x;
else
b += x;
}
System.out.println("a is " + a);
System.out.println("b is " + b);
a
is and the value of b
is .