Tech Support Guy banner
Status
Not open for further replies.

Print pyramid in following pattern in javascript

882 views 1 reply 2 participants last post by  colinsp 
#1 ·
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.
You have insufficient privileges to reply here.
Top