Computer Science, asked by ksiddharth719, 1 year ago

write a algorithm to find the reverse of a number​

Answers

Answered by shivu0518
3

Answer:

Input:  num

Initialize rev_num = 0

Loop while num > 0

    Multiply rev_num by 10 and add remainder of num  

         divide by 10 to rev_num

              rev_num = rev_num*10 + num%10;

    Divide num by 10

Return rev_num

Similar questions