C Programs

Write a C program which reverse the number?


/* C Program which Reverse the number*/
#include <stdio.h>
#include <conio.h>
int main() {
 int number; /* give input here */
 int rev = 0;
 int num;
 clrscr();
 printf("Enter The number : ");
 scanf("%d",&number);
 num = number;
 while (num > 0) {
      int rem = num % 10;
      rev = rev*10+ rem;
      num /= 10;
 }
 printf("Given number : %d\n",number);
 printf("Reverse Number : %d ",rev);
 printf("\n");
 getch();
 return 0;
}
    
www.000webhost.com