18
Answers

How to write a countdown program in C + +

Ask a question
Ken H

Ken H

12y
4.1k
1
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)