3. Triangle Patterns #

Created Friday 18 October 2019

Just solve for the 3 questions. Beware of the spaces. For the given pattern, for n = 4. 1 2 3 3 4 5 4 5 6 7 Q1) no. of rows = N Q2) no. of columns = i Q3) What to print, there are two methods here, either formulate an epression for (i,j) or just start with i and print i terms. Here, I’ll use the latter because it’s obvious and easy to code. Here the val will be initialized to i, after every newline.

in this question, 1 2 3 4 5 6 7 8 9 10. Here Q1 and Q2 are same. We can either cout i + j, or just declare a variable k, and keep track of it till the end of the program.