All pastes #979557 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-04-10 13:14 UTC
rendered paste body
#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char *argv[])
{
    const int Limit = 1000;
    const int Multiplier = 2;
    int In1, Tracker = 0; 
    
    cout << "Enter a number less than 10." << endl;
    cin >> In1;
    
    if (In1 > 10)
       cout << "Your number is too high!" << endl;
    else 
     {
         while (In1 < Limit)
           {
             In1 = In1 * Multiplier;
             Tracker++;
           if (In1 < Limit)
             cout << In1 << endl;
           else
             out << "The loop reoccured " << Tracker << " times." << endl;
           }
      }             
system("PAUSE");
return 0;