Cognizant Interview Question

Pattern base program. Like print star in triangle shape