Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

20.) int count = 0; for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++)

ID: 3824916 • Letter: 2

Question

20.) int count = 0;

for (int i = 0; i < 10; i++) {

for (int j = 0; j < 10; j++) {

count++;

}}

What is the value of count after the code executed?

21.) When solving a complex problem using software, one should start out by implementing a few ideas. The various code snippets will take us to the final solution.

22.) A linear homogeneous array is one of the most powerful data structures; but requires that each member is of the same data type and the data must reside in consecutive memory.

b.) False

23.) int x = 10;

if (x < 10)

x = 2;

else if (x < 100)

x = 3

else

x = -9999

24.) int x = 0;

for (int i = 10; i > 0; i--) {

x++;

}

What is the value of x after the code executed?

a.) 10

Explanation / Answer


20)
  
Ans: c) 100

We have two nested for loop, each runs 10 times

21)
Ans: True

22)
True

23)
b.) The else if component will execute because x is less than 100 but greater than 9

24)
Ans: c) 10

for loop runs 10 times from i=10 to i=1