// CountUp.C
// Math 120 Solution to Hw 2, Program 1.

#include<iostream.h>

// Count up to a given number and print bingo, using recursion.

void countUp( int target, int nowAt ) {
   if ( target==nowAt ) {
     cout << "Bingo!" << endl ;
   }
   else {
     nowAt = nowAt + 1 ;
     cout << nowAt << endl ;
     countUp( target, nowAt ) ;
   }
}


void main() {
   int bingo ;
   cout << "Enter bingo number: " ;
   cin >> bingo ;
   if ( bingo < 1 ) {
      cout << "Number must be positive." << endl ;
      return ;
   }
   countUp(bingo, 0 ) ;
}
