Friday, September 12, 2008

REVERSE A NUMBER programming in c programming language


void main()
{
  int num,sum=0,r;
  clrscr();
  printf("\nEnter a number:");
  scanf("%d",&num);
  while(num)
  {
            r=num%10;
            sum=sum*10+r;
            num=num/10;
  }
   printf("\nReverse number=%d",sum);
  getch();
}

No comments:

Post a Comment

Thanks to given comments.......

My Blog List