ok
like this or how pls
#include <iostream>
using namespace std;
int main()
{
int a=20, b=40, c=60;
bool d= true;
while (a<b)
cout << d;
while (a>b)
break;
}
#include <iostream>
usingnamespace std;
int main()
{
int a=20, b=40, c=60;
bool d= true;
while (a<b)
cout << d;
while (a>b)
break;
}
Here's a program that won't repeat:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
usingnamespace std;
int main()
{
int a=20, b=40, c=60;
bool d = true;
while (a < b)
{
cout << d;
a = b; // a is no longer less than b
}
cout << "out of the loop" << endl;
}
In case it's not clear, the question your asking makes no sense because you're providing no context for what you're trying to do. A loop that always only runs once shouldn't be a loop in the first place. Rather, it should be an if statement.
When you make a reply, you can see the main text box where you can type. Look just to the right... It says format: and under are a bunch of buttons to choose from. The very first button is for code. It looks like this "<>".