What is the meaning of loop in this?

while(N>0)
{
cin>>no;

given while loop will execute till N>0.

then why do we use cin>>no; after it?

You may be required to take input, see whatever we do inside loop depends upon logic or what program demands. The concept is
while(SOME CONDITION){
… your work…
}
Here work is done till CONDITION is true.
If you still have doubt then share the problem statement of this code.

1 Like