#include <iostream>
#include <conio.h>
using namespace std;
main()
{
int a,b;
b=50;
cout<<"enter a value less than 50: ";
cin>>a;
do
{
cout<<"A number: "<<a<<endl;
a++;
Sleep(100);
}
while (a<=b);
getch();
return 0;
}

what does not work means?
It is very general term. Please say exactly what does not work. Errors, et al

You need to include Windows.h

thank you exact answer.

next time post error! error like one below helps than "it doesn't work"
double for.cpp:16: error: 'sleep' was not declared in this scope

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.