int count = 0;
for (int i = 1; i <= 20; i++) {
if (i % 2 == 1) {
count++;
}
}
System.out.println(count);What is printed?
- Acheck_circle
10
- B
11
- C
20
- D
9
Explanation
Odd numbers from 1 to 20 are 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 — exactly 10 numbers.