Help me in solving CLB058 problem

My issue

why is it char x[10];??

My code

#include <stdio.h>

int main(void) {
        char x[10];
	scanf("%s", x);
	printf("Hello %s", x);
	
	return 0;
}


Learning course: Learn C
Problem Link: CodeChef: Practical coding for everyone

when we write char x ,it means x can only be a character not name .To store name of characters we need array so here we’re defining an array of characters to take the name as input.

you are trying to store 10 charector in char array (string) but in scanf you did not mention the size you can try adding this

scanf(“%9s”,x);

9 becouse the index start from 0