43.2k views
2 votes
(var count2 = 0; count2 < 3; count2++)

User RoyalTS
by
3.4k points

1 Answer

2 votes

Answer:

3 times

Step-by-step explanation:

Given

The above loop

Required [Missing from the question]

Times the loop is executed

From the question, we have:

count2 = 0 ----- Start

count2 < 3 ----- End. This means (2) because 2 < 3

coun2++ ----- Increment of 1

This means that count2 will be incremented by 1 from 0 to 2.

So, the values of count2 at each loop is:

count2 = 0, 1, 2

Hence, the loop is executed 3 times

User FreshPow
by
3.5k points