Web Analytics

Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user will enter a number. The program should generate a ladder of X wherein the level depends on the number entered and the character should dictate whether it faces right or left.


Sample:


Character is r

Number is 3


Output

X

XX

XXX


Character is r

Number is 6

X

XX

XXX

XXXX

XXXXX

XXXXXX


Character is l

Number is 5


X

XX

XXX

XXXX

XXXXX