CJCoding With Joseph
15free / daySign inCreate account
โ† Back to Question List
Java Code Walkthrough #14

Counting Multiples in a Loop

easyLoops

๐Ÿ“„ Code

Read carefully โ€” what does this print?
1public class Main {
2 public static void main(String[] args) {
3 int count = 0;
4 for (int i = 1; i <= 10; i++) {
5 if (i % 3 == 0) {
6 count++;
7 }
8 }
9 System.out.println(count);
10 }
11}

๐ŸŽฏ Your Answer