Created
October 17, 2017 17:45
-
-
Save JohnPhamous/6c3d9d54242f68cf0c99cc39aa924840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
cout << "Enter a number between -50 and 50: " << endl; | |
int userInt; | |
cin >> userInt; | |
if (userInt > 50 && userInt < -50) { | |
return 0; | |
} | |
if (userInt == 0) { | |
cout << "Your number is " << userInt << endl; | |
} | |
if (userInt % 10 == 0) { | |
if (userInt > 0) { | |
cout << "Your number is a positive multiple of 10" << endl; | |
} | |
else { | |
cout << "Your number is a negative multiple of 10" << endl; | |
} | |
} | |
if (userInt % 100 != 0) { | |
if (userInt > 0) { | |
cout << "Your number is positive and "; | |
} | |
else { | |
cout << "Your number is negative and "; | |
} | |
cout << "is between " << (userInt - userInt % 10) << " and " << (userInt - userInt % 10) + 10 << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment