How to read string in C : I try to run this code in c and expected runtime error but actually it did run,can you tell me the reason?

        char str[10];
        scanf("%s",str);
        printf("%s",str);
As i initialized the size of array as 10,how can code prints string of more  than 10 letters?