I d id nt understood how and by which condition output stopped at 7

i didnt understood how and by which condition output stopped at 7

hi @guptanikhil898 please tell the time stamp

i didnt understood how and by which condition output stopped at 7
time ->
8:44

@guptanikhil898 the condition is while(!q.empty()) so the loop will stop when the queue becomes empty. Since we pushed 7 in the end, it will be the last element to be popped out, after 7 is popped out the queue will become empty and the loop will not be executed further

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.