Search This Blog

Translate

C program using function to print reverse the number

C program using function to print reverse the number


#include
#include
int rev(int);
void main()
{
 int n;
 clrscr();
 printf("\n Enter the number:");
 scanf("%d",&n);
 rev(n);
 getch();
}
int rev(int n)
{
 int s=0;
 if(n==0)
  return ;
 else
   s=n%10;
   printf("%d",s);
   n=n/10;
   rev(n);
   return;

}

C Program example List

Google+ Badge