/* Programming to print  a number in reverse order */
#include<stdio.h>
#include<conio.h>

main()
{
	long int sum,n,a,b,c;
	clrscr();
	printf("Enter Number");
	scanf("%ld",&n);
	for(sum=0;n>0;)
	{
		a=n/10;
		b=a*10;
		c=n-b;
		sum=sum*10+c;
		n=a;
	}
	printf("\Reverse order =%ld",sum);
	getch();
}
/* input: 32
   output:23
   loop process:
   step 1: sum=0,n>0 ie: 32 > 0 condition true so
	   a=n/10 	ie: a=32/10 	ie a=3
	   b=a*10 	ie: b=3*10  	ie b=30
	   c=n-b  	ie: c=32-30 	ie c=2
	   sum=sum*10+c ie: sum=0*10+2 	ie sum=2
	   n=a          ie: n=3
   step 2: sum=2,n>0 ie 3 > 0 condition true so
	   a=n/10	ie: a=3/10  	ie: a=0
	   b=a*10	ie: b=0*10  	ie: b=0
	   c=n-b	ie: c=3-0   	ie: c=3
	   sum=sum*10+c ie: sum=2*10+3  ie: sum=23
	   n=a		ie: n=0
   step 3: sum=23,n>0 ie:0>0 condition is false so

	   output: reverse order=23
   */
/* Exercise: 1: To check the given number is Palindrome or not
		step 1: To find reverse of the given number
		step 2: To check the given number and reverse of the number are equal
			ie: palindrome else not palindrome
*/