0
Why not code coach problem is not solved from this code? Extra t. All case are solved only 5 one is not solve why tell me. 🙏
#include <stdio.h> void reverse (char *a) { if (*a) { reverse (a+1); printf ("%c",*a);}} int main() { char a[30]; scanf("%[^n]s",&a); reverse (a); return 0; }
6 Réponses
+ 1
It's "\n" not "n"
+ 1
Thanks 🙏
0
The problem is in the scanf. You meant to do [^\n] and also you don't need the '&' because the array name is a pointer.
edit. Anyway as a suggestion: the problem is not that complex to require a recursive function. A simple for loop can do the job. Try to make a more efficient recursive solution.
0
I make this one but it not successful
0
[^n] is important with it not reverse second word