i have to reverse the position of integer like this
input = 12345
output = 54321
i made this but it gives wrong output e.g 5432
#include
The following code works for a two-digit number only.
#include using namespace std; int main() { int n; cin >> n; cout << (n%10) << (n/10); return 0; }