154k views
1 vote
A while loop is somewhat limited, because the counter can only be incremented by one each time through the loop.

True False

User Iamarnold
by
5.9k points

1 Answer

5 votes

Answer:

False

Step-by-step explanation:

In a while loop we can increment the counter by any number that we wish. It is not that the counter can only be incremented by one each time through the loop.

Below is an example of a while loop with counter incremented by 5 each time.

int count=0; //initialize count to 0

while(count<50){ //continue the loop till count is lesser than 50

cout<<count; //display the value of count

count = count + 5; //increment counter by 5 each time

}

User Tom Michew
by
5.5k points