Mega Code Archive
Skip the body of the while loop when the condition is false
#include
int main()
{
int counter = 3;
while (counter > 0)
{
std::cout << "Hello!\n";
counter--;
}
std::cout << "counter is OutPut: " << counter;
return 0;
}
Hello!
Hello!
counter is OutPut: 0