Which of the following loops prints "Welcome to Java" 10 times?
A:
for (int count = 1; count <= 10; count++) {
System.out.println("Welcome to Java");
}
B:
for (int count = 0; count < 10; count++) {
System.out.println("Welcome to Java");
}
C:
for (int count = 1; count < 10; count++) {
System.out.println("Welcome to Java");
}
D:
for (int count = 0; count <= 10; count++) {
System.out.println("Welcome to Java");
}
a. BD
b. ABC
c. AC
d. BC
e. AB
e In (A), the loop displays Welcome to Java 10 times for count from 1 to 10 . In (B), the loop displays Welcome to Java 10 times for count from 0 to 9 . In (C), the loop displays Welcome to Java 9 times for count from 1 to 9 . In (D), the loop displays Welcome to Java 11 times for count from 0 to 10 . Therefore, the correct answer is AB.