4 Digit Number Reverse C Program
#include <stdio.h>
#include <conio.h>
main()
{
int num,num2,rev,d1,d2,d4,d3;
printf(" Please Enter A 4 Digit Number To Reverse It ");
scanf("%d",&num);
num2=num;
d1=num2%10;
num2=num2/10;
d2=num2%10;
num2=num2/10;
d3=num2%10;
num2=num2/10;
d4=num2;
rev=(d1*1000)+(d2*100)+(d3*10)+(d4);
printf("\n The Reverse Of %d Is = %d \n",num,rev);
printf("\n CREATED BY WWW.SHAILESHNPATIL.blogspot.com ");
getch();
}
Output :