Countdown to the liftoff with a delay created by for loop. - C++ Data Type

C++ examples for Data Type:int

Description

Countdown to the liftoff with a delay created by for loop.

Demo Code

#include <iostream>
using namespace std;
int main()//w  w w. j a v  a  2s. com
{
   int cd, delay;
   for (cd=10; cd>=0; cd--)
   {
      {
         for (delay=1; delay <=30000; delay++);
      }  // Delay program.
      cout << cd << "\n";           // Print countdown value.
   }                                   // End of outer loop
   cout << "Blast off!!! \n";
   return 0;
}

Result


Related Tutorials