hi im new to c++ and have just built this count down (see below) and i was wondering does any one know how to add a 1 second pause between each value been displayed so in effect it will count down in seconds
#include <iostream>
using namespace std;
int main ()
{
int n;
int a;
cout << "Enter the starting number >";
cin >> n;
while (n>0) {
cout << n << ", ";
--n;
}
cout << "\n Countdown ended\n";
cout << "\n\n";
cout << "\n Press any key then enter to exit\n";
std::cin >> a;
return 0;
}
float secs = 1.2;
clock_t delay = clock_t(secs * CLOCKS_PER_SEC);
clock_t start = clock();
while (clock() - start < delay );
//Then do what you want to do