Inverse of a number

please help with this code i am not able to figure it out

hi @samyakjain1050_65748654e19948da
Inverse is basically inverting the places of any number with its value.

For e.g…,
Before Inverse

  • Places --> 5 4 3 2 1
  • Value —> 3 2 1 4 5

After Inverse

  • Places --> 5 4 3 2 1
  • Value —> 1 2 5 4 3
Algo

1.Declare a Place variable that will keep track of the place number for which we are processing the work.
2.The value can be extracted by performing modulus operator on the given number.
3.In order to inverse the place and the number extracted in points 1 and 2 multiply the place with 10 ^ (rem - 1).
For e.g…, Place = 4 and rem = 3, then multiply place with 100 viz, ( 10 ^ (rem - 1)). 4.Add the number to the previous ans.

refer this code -->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.