Question: Java Test 11) How many times will the following code print Welcome to Java? int count = 0; do { System.out.println(Welcome to Java); } while

Java Test

11) How many times will the following code print "Welcome to Java"? int count = 0; do { System.out.println("Welcome to Java"); } while (count++ < 10);

11) A) 11 B) 0 C) 8 D) 9 E) 10

12) What is sum after the following loop terminates? int sum = 0; int item = 0; do { item++; sum += item; if (sum > 4) break; } while (item < 5);

12) A) 5 B) 7 C) 6 D) 8

13) What is i after the following for loop? int y = 0; for (int i = 0; i<10; ++i) { y += i; }

13) A) 9 B) 11 C) 10 D) undefined

14) How many times will the following code print "Welcome to Java"? int count = 0; while (count < 10) { System.out.println("Welcome to Java"); count++; }

14) A) 11 B) 8 C) 0 D) 10 E) 9

15) How many times will the following code print "Welcome to Java"? int count = 0; while (count++ < 10) { System.out.println("Welcome to Java"); }

15) A) 0 B) 10 C) 9 D) 11 E) 8 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!