0
What's wrong here?
#include <stdio.h> #include <string.h> int main() { char txt[200]; int L,i; printf("veuillez taper un texte: \n"); gets(txt); L=strlen(txt); for(i=L-1;i>=0;i++) { printf("%c",txt[i]); } return 0; }
3 Respostas
+ 6
Remove the first printf, it is not necessary to print texts that aren't required in challenges.
Since the program is iterating the char backwards, the incremention should be i-- and not i++.
https://code.sololearn.com/cuPDf6R4Nwi5/?ref=app
+ 4
And use fgets() instead of gets()
fgets(txt, 200, stdin);
+ 1
Ty it works