A

Admin • 828.03K Points
Coach

Q. What will be the output?
for(int i = 0; i < 10; i += 2) {
System.out.print(i + " ");
}

  • (A) 0 1 2 3 4 5 6 7 8 9
  • (B) 0 2 4 6 8
  • (C) 2 4 6 8 10
  • (D) 1 3 5 7 9
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Loops

Explanation by: Admin
The loop increases i by 2 each time, starting from 0.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.