For starters you need to include the header <string.h>.
This loop
for(i = 0; i < 50;i++)
scanf("%[^\n]c",&s[i]);
does not make a great sense. Moreover you need to append the entered string with the terminating zero character '\0'.
What you need is to enter a string one time as for example
scanf("%49s", s );
Or even better to write
scanf( "%49[^\n]", s );
to enter a string with several words in the array.
This for loop
for(n = strlen(s), i = 0; n > i; n--,c++)
s[c] = s[n-1];
also does not make a sense. It does not reverse the string. The variable i is not increased. That is you need to swap two characters.
Also you need to declare variables in minimum scopes where they are used.
The loop can look for example the following way
for ( size_t i = 0, n = strlen(s); i < n / 2; i++ )
{
char c = s[i];
s[i] = s[n-1-i];
s[n-1-i] = c;
}
Apart from all these the declared array a is not used in the program.
So the program can look the following way
#include <stdio.h>
#include <string.h>
int main( void )
{
char s[50] = "";
scanf( "%49[^\n]", s );
for ( size_t i = 0, n = strlen(s); i < n / 2; i++ )
{
char c = s[i];
s[i] = s[n-1-i];
s[n-1-i] = c;
}
puts( s );
}
If to enter string
Hello, unikatura!
then the program output will be
!arutakinu ,olleH
sbuffer is not NUL-terminated when you do it like this, which will causestrlen()to exhibit undefined behavior.