Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Project4/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,28 @@ void pause() {
}
//MAIN
void main() {
int y = 0;
while (y < 30) {// forces code to continue 30 times
int x;
cout << "Choose a three digit number." << endl;
cin >> x;
cout << "Nice Choice Loser" << endl;
int A = x / 100 ;
int B = x % 100 / 10 ;
int C = x % 10 ;

int A = x / 100 ; //first equation to get first number
int B = x % 100 / 10 ; //second equation to get 2ed number
int C = x % 10 ; //3ed equation to get third number.
cout << endl;
y = y + 1;
if ((A > B) && ( B > C)) {
cout << "descending" << endl;
cout << x << " is descending" << endl;
cout << endl;
}
else if ((A < B) && (B < C)) {
cout << "acscending" << endl;
cout << x << " is acscending" << endl;
cout << endl;
}
else {
cout << "neither" << endl;
cout << x << " is neither" << endl;
cout << endl;
}
pause();
}
}