+ Reply to Thread
Results 1 to 2 of 2

Thread: CountDown [C++]

  1. #1
    Join Date
    Jan 2008
    Location
    PA
    Posts
    1,164
    Points
    2,090,239.25
    Rep Power
    209

    Default CountDown [C++]

    you enter in a # then it will decrement until it reaches 0
    Code:
    //SonniE's CountDown
    #include <iostream>
    using namespace std;
    int main ()
    {
      int x;
      char direction;
      cout << "Welcome To SonniE's Countdown!!\n";
      cout << "Enter the direction you want to count(d = down a = accross): ";
      cin >> direction;
      if (direction == 'd')
      {     
      cout << "\nEnter the starting number: ";
      cin >> x;
                while (x > 0) 
      {
        cout << x << "\n ";
        --x;
      }
      
      cout << "BlastoFF!!\n";
      system("pause");
      }      
      if (direction == 'a')
      {
                      cout << "\nEnter the starting number: ";
      cin >> x;
                while (x > 0) 
      {
        cout << x << ", ";
        --x;
      }
      cout << "BlastoFF!!\n";
      system("pause");
      return 0;
    }
    }
    Attached Files
    Last edited by SonniE; 06-02-2008 at 07:05 PM.


    Get Vip: »Here«
    Donate: »Here«
    >>List of Compilers<<
    >>SFDM Name Generator<<
    [Owner Of FluidCoding]

  2. #2
    Join Date
    Feb 2008
    Location
    C:/Windows/System32
    Posts
    53
    Points
    28,306.00
    Rep Power
    200

    Default

    pretty fun code 2 mess around with

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts