TATA ELXSI Interview Question

star pattern in any programming language.