C Program To Reverse A Given Number

C Program To Reverse A Given Number

#include<stdio.h>

int main()
 {
   int num, rem, rev = 0;

   printf("Enter any no to be reversed :\n");
   scanf("%d", &num);   //input from user

   while (num >= 1)
   {
      rem = num % 10;
      rev = rev * 10 + rem;
      num = num / 10;
   }

   printf("Reversed Number : %d\n", rev);   //Print Output On screen

}
Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics