char num_str[6], *str = num_str;
long number;
int i;
str += 5;
*str = '\0';
str--;
printf( "Enter the five-digit number.\n");
scanf( "%ld", &number );
if( number <= 99999L ){
while( number >= 10 ){
*str-- = '0' + (int)( number % 10L );
number /= 10;
}
*str = '0' + (int)number;
for( i = 0 ; i <= 5 ; i++ )
printf( "%c", str[i] );
댓글 없음:
댓글 쓰기