Cognizant interview question

Write a logic to print patterns