> calculate the modulo-10 of the value using % ...
the value may be negetive; you need to adjust for that.
al alternative is
a. convert the number to a string
b. reverse the string
c. convert the string back to a number.
eg.
int reverse( int number )
{
bool negetive = number < 0 ;
if( negetive ) number = -number ;
ostringstream ostm ;
ostm << number ;
string str = ostm.str() ;
// c++0x => string str = lexical_cast<string>(number) ;
reverse( str.begin(), str.end() ) ;
istringstream istm(str) ;
int result ;
istm >> result ;
// c++0x => int result = lexical_cast<int>(str) ;
return negetive ? -result : +result ;
}