+ 2
How to program while loop in cpp in sololearn?
8 Answers
+ 4
The loop will have following syntex:-
while(condition)
{
statements;
}
Here is the description for you:-
1. Here condition is the conditions which you are applying for the integer or float value.
2.Do not forget to miss the updatation part in statements otherwise it will cause error and will become an infinite loop
+ 6
while ( condition )
{
statements;
}
// In the normal way =^=
+ 6
try this
bool runLoop = true;
while(runLoop == true)
{
cout << " i am looping";
}
this creates a loop that runs forever. you could prompt the user to end the loop inside said loop and if they say yes. you would set runLoop to false. This would end the loop.
+ 4
you didnt just type what maz said word for word did you?
+ 3
not sure you wouldve got to this yet in the course. Pretty sure they cover it
+ 3
while(true){
cout << "some text" << endl;
}
+ 2
its not working the said way maz
+ 1
while(x<=100)
{
cout<<"mazen";
i++;
}