Cyntexa interview question

Code to print given triangle pattern.