Tech Support Guy banner

Print pyramid in following pattern in javascript

800 Views 1 Reply 2 Participants Last post by  colinsp
I want to print pyramid in javascript as shown below:-
when a function is called like pyramid(5)
1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9

I need number of lines that is passed as parameter

Thanks
Status
Not open for further replies.
1 - 2 of 2 Posts
This sounds like a homework question and we don't do that here.

If it's not then what code do you have so far and what's not working?
1 - 2 of 2 Posts
Status
Not open for further replies.
Top