New course! Every coder should learn Generative AI!
Try a free lesson+ 2
How many times this for loop runs
int i=0,k=8; for(i=0;i <10&&k>5;i++,k--) cout <<"hello";
2 Answers
+ 1
8-5=3
10-0=10
3 is smaller, hence 3
+ 3
3
the loop stops when k=5
int i=0,k=8; for(i=0;i <10&&k>5;i++,k--) cout <<"hello";