+3

What does it mean to prime a loop?

I usually come across cases where programmers "prime a loop", and also discovered that it's most common with while loops. So please what it means to "prime a loop". Example: https://code.sololearn.com/csppg96TX9U8/?ref=app

10/20/2019 12:19:40 PM

A_Coder

1 Answer

New Answer

+2

The condition at the beginning of a while loop has to make sense even the first time it is tested, before the body of the loop is executed. To prime the loop is to set things up before the loop starts so that the test makes sense