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

The Datasheet form layout resembles a spreadsheet, with cells for entering data.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The Live Tiles feature in Windows 8 give users a constant stream of information, but the user can also switch the option off

Indicate whether the statement is true or false

Computer Science & Information Technology

The System.IO namespace contains classes and methods to ________.

a) access files and directories b) display graphics in an application c) insert multimedia into an application d) All of the above.

Computer Science & Information Technology

In a circular linked list with more than one node, it is convenient to make the pointer first point to the middle node of the list.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology