Reverse Any Number – C Program

#include <stdio.h>
#include <conio.h>

//Reverse Number - FScOnline.info

int main()
{
  int num,rev=0,mod;
  
  printf("Enter Number: ");
  scanf("%d",&num);

  while(num!=0)
  {
    mod=num%10;
    rev=(rev*10)+mod;
    num=num/10;
  }

  printf("Reverse Number: %d",rev);
  
  getch(); 
  return 0;
}

 Output

c-program-reverse-any-number

Categories: C Language,C Programs,Computer Science

Tags: ,

Leave A Reply

Your email address will not be published.

×