C Program to Print Number Pyramid Pattern

Generate Following Pattern of Pyramid
Program :

Output :

Explain ?

  •  Gotoxy : interpret it as “goto x y”
  • Moves Cursor Position to Co-Ordinate (x,y)
  • gotoxy(10,40) : moves Cursor Position to Co-ordinate (10,40)

  • In Each Iteration we are moving downward so increment “y”
  • For each new Iteration we are starting from beginning but one co-ordinate back so decrement x

  • Nested Loop Used to Print All the Numbers in Particular Line . i.e in the third line i = 3 so j will print values 3 times .