Question

How can I write a program that loops forever (infinite loop) printing the letter "a", using a while loop?
while(this statement is true)
do this

should be fairly straight forward as to what you need.
Right direction?

int iii = 0;
while (iii < 10)
cout << iii << "a ";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

using namespace std;

int a=0;

int main()
{
while (a==0)
{
cout << "a";
}

return 0;
}
while(1) {/*code*/}
or even more explicit
while(true) {/*code*/}
Topic archived. No new replies allowed.