Reverse the number formed .
while ( num > 0 ) : NEW_LINE INDENT rev = rev * 10 + ( num % 10 ) ; NEW_LINE num //= 10 ; NEW_LINE DEDENT if ( check0 == 1 ) : NEW_LINE INDENT return rev - 1 ; NEW_LINE DEDENT return rev ; NEW_LINE