#include <iostream>
using namespace std;
int main() {
#include <iostream>
using namespace std;
// variable declarations
int number;
//start program
cout << "Hell I'd like to sing you a song" << endl;
cout << "Enter a number: ";
cin >> number;
cout << number << " bottles of Gatorade on the wall," << endl;
cout << number << " bottles of Gatorade!" << endl;
cout << "Take 1 down, pass it around,"<< endl;
cout << number - 1 << " bottles of Gatorade on the wall!" << endl;
while ( number > 0 ){
cout << number -1 << " bottles of Gatorade on the wall," << endl;
cout << number -1 << " bottles of Gatorade!" << endl;
cout << "Take 1 down, pass it around," << endl;
cout << --number -1 << " bottles of Gatorade on the wall." << endl;
}
if ( number = 1){
cout << "1 bottle of Gatorade on the wall" << endl;
cout << "1 bottle of Gatorade on the wall" << endl;
cout << "Take 1 down, pass it around," << endl;
cout << "0 bottles of Gatorade on the wall." << endl;
}
// Exit program.
return 0;
}
This post has been edited by jimblumberg: 02 February 2012 - 06:50 AM
Reason for edit:: Added missing Code Tags, Please learn to use them.

New Topic/Question
Reply



MultiQuote






|