five times. I trust that you can see why this is so?
First you need to analyse the pattern, and understand the logic behind it.
- What is the relationship between the numbers on a line. How is that line generated?
- What is the relationship between one line and the next? Is there a simple pattern that would allow you to know, given one line, what numbers should be on the next line?
Once you understand the pattern, then you can think about coding it.
i tried hard nbut couldn't understand how to print 7
Printing is something you do with code.
I've already told you, don't bother thinking about code until you've understood the logic of the pattern. You shouldn't be thinking about printing anything at all, until you've done that.
Hint:
For the FIRST row, each number is one higher than the previous one.