Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ run loop for 5 seconds

#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)
	}
}

Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ unary minus overload 
Cpp :: border radius layout android xml 
Cpp :: random in range c++ 
Cpp :: min heap in c++ 
Cpp :: print queue c++ 
Cpp :: priority queue c++ time complexity 
Cpp :: if not defined c++ 
Cpp :: how to get a word from file c++ 
Cpp :: BMI Calculator Program in C++ 
Cpp :: access first value in a set c++ 
Cpp :: input a string in c++ 
Cpp :: addition without arithmetic operators c++ 
Cpp :: math in section title latex 
Cpp :: Sort array using inbuilt sort function in decreasing order 
Cpp :: error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": 
Cpp :: arduino notone 
Cpp :: how to declare 1-D array in C/C++ 
Cpp :: kruskal in c++ 
Cpp :: double to string c++ 
Cpp :: counting sort c++ 
Cpp :: calculator c++ 
Cpp :: c++ case 
Cpp :: take pieces of a string in c++ 
Cpp :: loop through a vector in c++ 
Cpp :: how to check if a number is prime c++ 
Cpp :: c++ random number within range 
Cpp :: armstrong number in cpp 
Cpp :: char ascii c++ 
Cpp :: destructor in c++ 
Cpp :: how to get the type of a variable in c++ 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =