Cognizant interview question

Program to print star pattern