mardi 23 mars 2021

How to write a program to print X OR O triangles which combinely form a box of matrix

How to write a pattern program which prints a output in the form like

Ex1: input : no of rows = 5

output : X O O O O
         X X O O O
         X X X O O
         X X X X O
         X X X X X

Ex2: input : no of rows = 3

 output : X O O
          X X O
          X X X 

Aucun commentaire:

Enregistrer un commentaire