+ 1
Extra-terrestrial error in C in 2 of 5 test cases
It seems everything to be ok to me, but it cant pass 2 of 5 test casses. Can you help me? #include <stdio.h> #include <string.h> int main() { char word[20]; scanf ("%s", word); int leng = strlen(word); int i; for (i=leng-1; i>=0; i--) { printf ("%c", word[i]); } return 0; }
4 Answers
+ 4
Try with bigger :) you'll pass đ
+ 4
Madalina Peter Think ,what if word is bigger than what you are accepting?
+ 2
I've tried with a smaller value but it doesn't work.
+ 2
Now it worked. Thank you very much for your help.