#include <iostream> #include <windows.h> using namespace std; int main(){ for (int i = 0; i < 5; i++) { cout << i << endl; Sleep(1000); // sleep for 1 second(1000 milliseconds) } }