Question | Value |
1 | 20 |
2 | 20 |
3 | 15 |
4 | 20 |
5 | 25 |
Total | 100 |
1. What is the value of variables i, j, and k at point A) and B) below?
i *= i + 1;
j %= i-- + 5;
k /= i = j + ++i;
// B) what is the value
of i, j, and k at this point?
public class test extends Applet {
public void paint(Graphics
g) {
int sum = 0;
for (int i = 10; i <= 60; i++) {
if (i % 2 != 0)
if (i % 3 != 0)
if (i % 5 != 0)
if (i % 7 != 0)
sum += i;
}
}
}
public class test extends Applet {
public void paint(Graphics g) {
for (int X = 0; X <= 200; X +=200)
for (int row = 0; row < 15; row++)
for (int col = 0, red = 0; col < 15 - row; col++, red += 255/15) {
g.setColor(new Color(red, 0, 0));
g.fillOval(X + col*12, row*12, 10, 10);
}
}
}