How many times is the println statement executed?
for (int i = 0; i < 10; i++)
for (int j = 0; j < 10; j++)
System.out.println(i * j);
a. 100
b. 20
c. 10
d. 45
a The outer loop is executed 10 times for i from 0 to 9 and the inner loop is executed 10 times from j from 0 to 9 . So the print statement is executed 100 times. The correct answer is A.
You might also like to view...
What processes involve the negotiation of changes to a contract between an acquiring organization and a supplier?
Fill in the blank(s) with the appropriate word(s).
Which of the following is not an example of a data abstraction?
a) float b) cmath c) ifstream d) an enumeration type
When creating a new VPN connection, what does a tunnel type of "Automatic" mean?
What will be an ideal response?
Which of the following is a Python keyword??
A. ?elif B. ?else C. ?def D. ?all of the above