91.4k views
4 votes
How many times is "Alert" displayed in the following loop? for (int k =0; k<= 100; k++) cout << "Alert"; O 101 0 1 oo О 99 O 100

User Manuel Pap
by
8.0k points

1 Answer

0 votes

Answer:

Hi, the answer is 100

Explanation:

In this case we have in the second parameter of the loop the condition to stop (k <= 100) it's means the iteration start at k=0 until k is less or equal to 100, in those iterations you get in the output (AlertAlertAlertAlert...)

I hope it's help you.

User Siros Fakhri
by
7.9k points