C Programming
Computer Programming

Program in c to Reverse a Number



Write a Program in c to Reverse a Number

\* C Program to to Reverse a Number *\

# include < stdio.h >
int   main( )
{

int   num, rev=0, rem  ;
printf(" Enter the Number : ") ;
scanf("%d ", & num) ;
do
{

rem = num % 10 ;
rev = rev * 10 + rem ;
num = num / 10 ;

}
while (   num   >   0 ) ;
printf(" \n Inverse of Integer is : ") ;
printf("%d ", rev) ;
return ( 0 ) ;

}

Output of Program :

Output of Program in C to Reverse a Number