Auto AdSense

Wednesday, 26 June 2013

C PROGRAM TO FIND THE REVERSE FORM OR IMAGE OF A GIVEN NUMBER USING WHILE LOOP.


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

main()
{
      int num,snum,digit,revfm;

      clrscr();

      printf("\n\n Enter a number to find its image : ");
      scanf("%d",&num);

      snum = num;
      revfm = 0;

      while(num > 0)
      {
                digit = num % 10;
                revfm = revfm * 10 + digit;
                num = num / 10;
      }
      printf("\n\n Image of the given number %d = %d\n\n",snum,revfm);

      return 0;
}

No comments:

Post a Comment