iOPEX Technologies interview question

1.Pattern program