| | Hi I am trying to code a program that will input five digit numbers and output it on the reverse order, The code will output the reverse, I still cant find how to check if the input is five digit or not, i have tried using " % / " but i couldn't make it to work, any hint will be appreciated. Thanks. This is my code Code: #include <iostream> #include <stdlib.h> using namespace std; int main() { int a,b,c,d,e,sum,find=0; cout << "Enter Your Number of Five Digits: " << endl; cin >> sum; a = (sum % 10); b = (sum % 100); b = b / 10; c = (sum % 1000); c = c / 100; d = (sum % 10000); d = d / 1000; e = (sum % 100000); e = e / 10000; cout << "The Reverse Order is: " << endl; cout << a << b << c << d << e << endl; } |

