write a algorithm to find the reverse of a number
Answers
Answered by
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