Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int num, digit, checker = 0, a = 0;
- cout << "Enter an interger: ";
- cin >> num;
- do
- {
- digit = num % 10;
- if (digit < checker)
- a = 1;
- checker = digit;
- num = num / 10;
- } while (num != 0);
- if (a == 0)
- cout << "The numerals are sorted in ascending order from right to left - nice =)\n\n";
- else
- cout << "The numerals are not sorted in ascending order from right to left - not nice at all =(\n\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement