BNT SOFT interview question

Write code to print pattern.