Pregunta de entrevista de Tata Consultancy Services

Write a code to print a star pattern.