Wipro Interview Question

Gave two programming questions to draw 2 patterns.