#include<stdio.h>
void main()
{
// programwithharsh//
int num,ln,r=0;
printf("Enter a five digit number= ");
scanf("%d",&num);
// programwithharsh//
ln=num%10;
r=r*10+ln;
num=num/10;
// programwithharsh//
ln=num%10;
r=r*10+ln;
num=num/10;
// programwithharsh//
ln=num%10;
r=r*10+ln;
num=num/10;
// programwithharsh//
ln=num%10;
r=r*10+ln;
num=num/10;
// programwithharsh//
ln=num%10;
r=r*10+ln;
num=num/10;
// programwithharsh//
printf("The reversed number = %d",r);
}
Tags:
Basic C program