C program to reverse any number.



#include<stdio.h>
int main()
{
  int num,revnum=0,rem;
  printf("\n Enter a number= ");
  scanf("%d",&num);
  while(num!=0)
    {
     rem=num%10;
     revnum=revnum*10+rem;
     num=num/10;
    }
  printf("\n The reverse number=%d", revnum);
  return 0;
}

  ***Input && Output***





***Input && Output***





   
         

Post a Comment

0 Comments