Ken H

Ken H

  • NA
  • 646
  • 361k

How to write a countdown program in C + +

Mar 15 2012 4:37 AM
hi all,
    How to write a countdown program.
 such as:
   #include<iostream>
using namespace std;
int main()
{
  int s;
  int SetSecondTime(int);
  s=SetSecondTime(60);
  if(s>0) cout<<"countdown is:"<<<<endl;
  else exit(0);
  return 0;
}
int SetSecondTime(int second)
{
    for(;second;second--) return second;
}
However, the above code and countdown function cannot be achieved.
thanks.

Answers (18)