how to write this pattern code in c langauge?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vishal purwar

    how to write this pattern code in c langauge?

    1
    2 3
    4 5 6
    7 8 9 10
    11 12 13 14
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    First, write a loop that cycles 14 times.

    Second, inside that loop write another loop that a) prints your number and b) based on the cycle of the outer loop displays a \n.

    You will need a loop counter in the outer loop that you can test inside the inner loop.

    Comment

    Working...