Cognizant Interview Question

how to print a pattern ?