Search
 
SCRIPT & CODE EXAMPLE
 

CPP

a c++ program to set a countdown timer

#include <iostream>
#include <conio.h>
#include <Windows.h>

using namespace std;

int main()
{
	int m,s;
	int total;


	
	cout<<"Enter m and s"<<endl;
	cin>>m>>s;


	
		for(int sec = s; s>=0; s--)
		{
			
			cout<<"You have "<<"minutes"<<m<<"seconds"<<s<<endl;
			Sleep(200);
			
			if(s ==0)
			{
             total = m*60;

			 for(int min = total; total>=0; total--)
			 {
		 cout<<"You have the remaining seconds"<<total<<endl;
				 Sleep(200);
			 }



			}
		}

	



	 system("pause");


}
Comment

a c++ program to set a countdown timer

#include <iostream>
#include <conio.h>
#include <Windows.h>

using namespace std;

int main()
{
	int m,s;
	int total;


	
	cout<<"Enter m and s"<<endl;
	cin>>m>>s;


	
		for(int sec = s; s>=0; s--)
		{
			
			cout<<"You have "<<"minutes"<<m<<"seconds"<<s<<endl;
			Sleep(200);
			
			if(s ==0)
			{
             total = m*60;

			 for(int min = total; total>=0; total--)
			 {
		 cout<<"You have the remaining seconds"<<total<<endl;
				 Sleep(200);
			 }



			}
		}

	



	 system("pause");


}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ alphabet array 
Cpp :: suppress individual warnings in visual c++ 
Cpp :: clear screen in c++ 
Cpp :: make cin cout faster 
Cpp :: separation between paragraphs latex 
Cpp :: c++ hello word 
Cpp :: how to sort a vector in reverse c++ 
Cpp :: npm install error 
Cpp :: c++ pause program 
Cpp :: c++ example 
Cpp :: Runtime Error: Runtime ErrorBad memory access (SIGBUS) 
Cpp :: sfml set font 
Cpp :: compute the average of an array c++ 
Cpp :: c++ get cursor position console 
Cpp :: fill two dimension array c++ 
Cpp :: write a code that adds two number 
Cpp :: retourner pointeur de type qstringlist qt 
Cpp :: screen record ios simulator 
Cpp :: fast input and output c++ 
Cpp :: c++ wait for user input 
Cpp :: c++ enum rand 
Cpp :: use regex replace in c++ 
Cpp :: copy substring to another string c++ 
Cpp :: how to display a variable in c++ 
Cpp :: how to delete a certain amount of numbers of the same value in multiset c++ 
Cpp :: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools" 
Cpp :: time delay in c++ 
Cpp :: cpp map iterate over keys 
Cpp :: c++ declaring and initializing strings 
Cpp :: how to find length of character array in c++ 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =