0
Can someone please give me a detailed explanation for this code? I copied it from a textbook, but can't understand how it works
9 ответов
+ 1
then put prints in every loop so you can follow the programm and see what happens
+ 1
The point is that the loops are going to increase the variable count and whenever
i is equal to 3 ,j is equal to 4 and k is equal to 5 the first loop stops and with it all other loops stop and the program outputs count
+ 1
np
0
if you put intervals on the both sides of all && operators things are gonna be much more clear.And if you still cant understand the code you need to learn loops
0
Thanks darkorbit17493 for the tip, but I can't understand whether that && Line is being executed or not?also if the inner loops work first or the outer
0
The main problem is that 'k' doesn't stop at 3 it goes on to become 4
0
Sounds good 👍
0
oh and what do you mean by k doesnt stop at 3 it have to stop only when i=1 and j=2
0
Thanks a lot darkorbit17493, your idea of printing at each step helped me analyze it clearly