Write your question here.
[code]
#include <iostream>
#include <conio.h>
#include <Windows.h>
using namespace std;
int main()
{
int s,total;
cout << "Please enter the number of second : ";
cin >>s;
for(int sec = s; s>=0; s--)
{
cout <<s<< " seconds remaining" <<endl;
Sleep(200);
if (s == 5)
{
cout << "Warning : " <<s<< " seconds remaining!" <<endl;
Sleep(200);
}
}
cout << "TIMES UP !" <<endl;
return 0;
}
how to make the output become :
6 sec remaining
warning ! 5 seconds remaining
so on..
if i want to make the output become :
6 seconds remaining
warning ! 5 seconds remaining
4 seconds remaining
3 seconds remaining
2 seconds remaining
1 seconds remaining
TIMES UP!
alright thank you mate :)