Answer to Question #265184 in C++ for ursula

Question #265184

How many time will the loop run?


for( int i = 19 ; i < 93 ; i++ )  

  


1
Expert's answer
2021-11-23T05:24:28-0500

The loop will run 74 times. Because in the first iteration, the counter i is initialized to 19, then the condition is checked whether 19 < 93, since the condition is true, the control enters the loop, then the counter is incremented by 1 and i now becomes 20, then the condition 20<93, since it evaluates to true, the control enters the loop again. This continues until when i is eventually incremented to 93 where the condition 93<93 becomes false and the control exits the loop. That means the loop runs from 19 to 92.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS