The thing is that you are using C Style Strings, and a C Style String is terminated by a zero.
For example if you'd want to print "alien" by using a char array:
char mystring[6] = { 'a' , 'l', 'i', 'e' , 'n', 0}; //see the last zero? That is what you are missing (that's why C Style String are also named null terminated strings, because they need that zero)
printf("mystring is \"%s\"",mystring);
The output should be:
mystring is "alien"
Back to your code, it should look like:
int main(void)
{
char a_static[5] = {'q', 'w', 'e', 'r', 0};
char b_static[5] = {'a', 's', 'd', 'f', 0};
printf("\n value of a_static: %s", a_static);
printf("\n value of b_static: %s\n", b_static);
return 0;//return 0 means the program executed correctly
}
By the way, instead of arrays you can use pointers (if you don't need to modify the string):
char *string = "my string"; //note: "my string" is a string literal
Also you can initialize your char arrays with string literals too:
char mystring[6] = "alien"; //the zero is put by the compiler at the end
Also: Functions that operate on C Style Strings (e.g. printf, sscanf, strcmp,, strcpy, etc) need zero to know where the string ends
Hope that you learned something from this answer.