PDA

View Full Version : CountDown [C++]



SonniE
05-25-2008, 08:38 AM
you enter in a # then it will decrement until it reaches 0


//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;
}
}

xr34p3rx
05-27-2008, 05:09 PM
pretty fun code 2 mess around with