Now I think I see what you're doing. You may have already fixed this, but just in case:
Basically it looks like you're trying to print "Hello World" to the screen once, then take user input. If the user input is a number less than or equal to 10, do all this again. If it's more than 10, break out of the loop and kill the program.
In that case, one of the problems that you're running into is that you're not getting the input inside the loop; you're only getting it once the loop has already terminated. Another issue is that it's not being assigned to x at all. Basically x is being initialized to 0, and then that never changes; that causes an infinite loop. Try the following code instead:
Code:
# include <iostream>
using namespace std;
int main()
{
int x;
do {
cout <<"Hello World";
cin >> x;
}
while (x <= 10);
return 0;
}
Or if that's not what you were trying to do, maybe this is:
Code:
#include <iostream>
using namespace std;
int main()
{
for (int i = 0; i <=10; i++)
{
cout << "Hello World";
}
return 0;
}
Or if necessary take ideas from both of these and use it to adapt your code.