Your local array s[20] is not initialized. So its elements can contain any values that were in memory before the array was allocated.
Also you are trying to compare integer value with a charavcter literal '\0'. It is not an error, but this construction usually is used with character arrays which have terminated zero.