How to print an entered string backwards in C using only a for loop

前端 未结 6 1095
日久生厌
日久生厌 2021-01-16 12:15

I want to print a string backwards. But my code seems to count down the alphabet from the last letter in the array to the first letter in the array instead of counting down

6条回答
  •  青春惊慌失措
    2021-01-16 13:20

    You're calling array values and not the specific index.

    for(x = end; x >= 0; x--) { printf("%c", word[x]); }
    

提交回复
热议问题