REVERSING NUMBERS WITHOUT STRING HEADER IN C

A problem stated that numbers needed to be reversed
eg:

INPUT - 12345
OUTPUT - 54321
CAN SOMEONE HELP ME WITH THIS.

int main()
{
long number,temp=0;
cin>>number;
while(number>0)
{
temp=temp*10+number%10;
number=number/10;

}
}

//