c program for the reverse the digits

后端 未结 8 1010
北恋
北恋 2021-01-07 11:27

I am looking for the C program for reverse the digits like below:

If i enter:

123456

Then the result would

8条回答
  •  醉话见心
    2021-01-07 11:45

    Use % 10 to get the last digit. Output it. Divide the number by 10 to get all but the last digit. Use % 10 to get the last digit of that. And so on, until the number becomes 0.

提交回复
热议问题