Wipro interview question

Gave two programming questions to draw 2 patterns.