c program for the reverse the digits

后端 未结 8 990
北恋
北恋 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:52

    Read the number in a char array A with scanf("%s", A) or, better, with fgets and output the char array reversed by outputting each character starting from strlen(A) - 1 to 0.

提交回复
热议问题