Display Patterns

Posted on October 23, 2017 by

Programs to display patterns like

  1. Right angled triangle (Orientation Right).
  2. Right angled triangle (Orientation Left).
  3. Given 'n', print the symbol 'Z' spanning n rows using '*' symbol. Value of n>2 and n<=20.

Right Angled Triangle (Orientation Right)

Enter the number of rows in triangle :: 6
Enter a character to be printed :: a
     a
    aa
   aaa
  aaaa
 aaaaa
aaaaaa

Right Angled Triangle (Orientation Left)

Enter the number of rows in triangle :: 6
Enter a character to be printed :: a
a
aa
aaa
aaaa
aaaaa
aaaaaa

Print Z

Enter size of 'Z' :: :: 6
******
    *
   *
  *
 *
******

Code

loading...

Fork Download

This website is made possible by displaying online advertisements to our visitors.
Please consider supporting by disabling your ad blocker.
loading comments...