+ 1
Why B and C are diffrent in this code
Why B and C are diffrent from A in this code? https://code.sololearn.com/WI4awQp2hJAM/?ref=app
1 Answer
+ 3
The loop first prints A and checks if the counter is 5. If not, then it continues and prints B. So it goes four times before finally meeting the === 5 criterium, when, after printing A, it returns to the main code.
C is outside the loop so never gets executed, as the function returns after five executions of the loop.