How to write an algorithm to reverse an integer ?

/* Part of this work is copied from http://www.sanfoundry.com/c-program-to-reverse-a-given-number/ */ #include <stdio.h> revint() { long num, reverse = 0, temp, remainder; printf(“Enter the number \n”); scanf(“%ld”,&num); temp = num; while ( num > 0 ) { remainder = num % 10; reverse = reverse * 10 + remainder; num /= 10; } printf(“Given number = …

Hacking with an algorithm to reverse an integer

$./app Sign detection [1] Power of two [2] Counting No. of bits set [3] Set or clear bits without branching[4] Find maximum value[5] Finding least common multiple[6] Finding the greatest commom divisor[7] Finding if a number is an Armstrong number or not[8] Finding if a given number is prime number[9] Finding the number of twin …