Do while statement : Do While « Language « C++






Do while statement

Do while statement



#include <iostream>
using namespace std;
const long delay = 10000000L;
int main()
{
   int tic;
   cout << "How often should be output? ";
   cin >> tic;
   do
   {
     for( long i = 0; i < delay; ++i )
        ;
     cout << "Output!\a" << endl;
   }
   while( --tic > 0 );
   return 0;
} 

           
       








Related examples in the same category

1.Do while loop with double value typeDo while loop with double value type
2.Do while loop with a input manipulatorDo while loop with a input manipulator