I am trying to make a program to reverse an integer and store it in a variable (without using arrays). For example if user enters 12345 as input, then output should be 54321. I have made it but the only problem are leading zeros. They get eliminated automatically. Like, if I enter input as 007, it will give output 7 but it should be 700. Below is the code I have made. I am looking for a simple solution to this problem without using advance techniques because I am a beginner.
Thank you very much for your reply. But it didn't solve my problem.
When you store "007" in a variable, let's say , of "int" type, it stores "7" but not "007. So before performing any operation, zeros are already eliminated.
Method you suggest above works for trailing zeros though. Like, if our input is "700" it will work.
Make a copy of the string of numbers first, send the copy to be reversed, then compare the the two strings. If they're the same, it's a radar number, same forward and backward.