clock countdown simulataion

please help urgent and provide some description...please




#include <conio.h>
#include <iostream>
using namespace std;
int seconds=0;
int main()
{
int countforwarning=0;
cout<<"Enter the number of seconds to be counted down: ";
cin>>seconds;
for(int i=0;i<500000000;i++)
{
if(i%100000000==1)
{
cout<<"Warning: "<<seconds<< " seconds remaining"<<"\n";
seconds--;
countforwarning++;
if(countforwarning>0 && countforwarning%5==0)
{
cout<<"\nAn additional warning \n";
}
if(seconds<0)
{
break;
}

}
}
system("PAUSE");
return(0);
}











the problem is it stops at 5 seconds and i want it to stop when the time ends\


please help
Last edited on
First, use code tags.

Second, use <ctime> to do timer.

Nice though.
Topic archived. No new replies allowed.