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. AB 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.

Computer Science & Information Technology

You might also like to view...

You can use the ________ command to place a copy of the selection on the clipboard and remove the selection from the original location

A) Cut B) Insert C) Delete D) Copy

Computer Science & Information Technology

A data series is a related set of:

A) headings. B) legends. C) chart sheets. D) data points.

Computer Science & Information Technology