How many times will "good luck" be printed: { int k; for(k=2;k<=10;k=k+5) {cout<<"good luck"<
Answers
Answered by
0
Answer:
2 Times
Explanation:
When program starts, loop will continue because 2<10. So, it'll print GOOD LUCK.
Now, after incrementation, value of k will become 7, which is still less than 10. So, statement will execute and once again GOOD LUCK will be displayed.
This time, after incrementation, value of k will exceed given condition. So, it will stop working, with final output being:
GOOD LUCK
GOOD LUCK
Similar questions