Ask Question

Evaluate the following code segment. What is the value of count after execution?

int count = 1;

for (int outer = 0; outer < 4; outer++)

for (int inner = 1; inner < 3; inner++)

count++;

1

3

9

12

13

+4
Answers (1)
  1. 22 May, 06:19
    0
    The outerloop loops 4 times (0,1,2 and 3), and the inner loop loops 2 times (1 and 2). So that is 8 increments of count that starts at 1. This should bring count to 9.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Evaluate the following code segment. What is the value of count after execution? int count = 1; for (int outer = 0; outer < 4; outer++) for ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers