In this C++ Program, the user needs to enter a value to start the count down process. Used while loop to repeat the decrement of the count down timer. Used windows.h header file.
#include #include using namespace std; int main() { int timer; cout << "Set the Number for Count Down Timer :"; cin >> timer; while(timer>0) { cout << timer <<endl; Sleep(1000); --timer; } cout << "Time is over Buddy :)\n"; return 0; }
OUTPUT:
Set the Number for Count Down Timer :5 5 4 3 2 1 Time is over Buddy :)