Step 1: Look at the static variable. static int x has no explicit initializer, so C sets it to 0. Being static, it keeps its value between calls.
Step 2: First call to test. It prints x which is 0, then x++ makes x become 1.
Step 3: Second call. x is still 1 from before, so it prints 1, then x++ makes x become 2.
Step 4: Third call. x is 2, so it prints 2, then x++ makes x become 3.
Step 5: The printed characters are 0, 1, 2 with no spaces added, giving 012. The answer is 0 1 2 (option B).