Texas Instruments Interview Question

Code how this pattern will form in C