+ 1

Can someone help with extra-terrestial question?.test case 3 not getting all other test cases are correct

#include <stdio.h> #include<string.h> int main() { char str[30]; fgets(str,30,stdin); int length,i,temp; length=strlen(str); for(i=0;i<(length /2);i++){ temp=str[i]; str[i]=str[length-1-i]; str[length-1-i]=temp; } printf("%s",str); return 0; }

1st Mar 2023, 12:43 PM
Nida Noushad
Nida Noushad - avatar
3 Answers
+ 3
Increase size of chat array.. The input may be beyond length 30. try 50
1st Mar 2023, 12:56 PM
Jayakrishna 🇼🇳
+ 2
2nd Mar 2023, 1:43 AM
Nida Noushad
Nida Noushad - avatar
0
text=input() print(text[::-1]) #it can help
1st Mar 2023, 4:41 PM
Herobrine
Herobrine - avatar