#include <iostream>
#include <windows.h>
//----------------------------
using namespace std;
//----------------------------   
int main () 
{
long int numbers=1;
bool on = true;

while (on==true) do
{
cout << numbers*4;
numbers = numbers+1;
Sleep(500);
}

}//--breaks here

how come the loop not work?

Recommended Answers

All 4 Replies

how come the loop not work?

Code not compile?
do...while

what my compiler writes when i try to compile:
18. expected `while' before '}' token
18. expected `(' before '}' token
18. expected primary-expression before '}' token
18. expected `)' before '}' token
18. expected `;' before '}' token

ohhh... it works now

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.