+ 1

Star patterns

How can I get this patterns using only for or while loop(no function)

25th May 2017, 6:55 PM
Manik Tafralian
Manik Tafralian - avatar
6 Answers
+ 1
can you draw the pattern
25th May 2017, 7:10 PM
MR Programmer
MR Programmer - avatar
+ 1
draw means:- ******** ****
25th May 2017, 8:57 PM
MR Programmer
MR Programmer - avatar
+ 1
var space = "&nbsp;&nbsp", star = "*"; for (var i = 0; i <2*8;i++){ for (var j=0; j <8+i; j++) { document.write( "&nbsp;&nbsp;" ); } for (var j=0; j <8-i; j++){ document.write(space + star); } {document.write("<br>"); j++ } }
25th May 2017, 10:20 PM
Manik Tafralian
Manik Tafralian - avatar
0
what do you mean to draw
25th May 2017, 7:36 PM
Manik Tafralian
Manik Tafralian - avatar
0
oh sorry the pic was not posted
25th May 2017, 10:17 PM
Manik Tafralian
Manik Tafralian - avatar
0
i need to draw diamond, i wrote this code, now need the upper part/ triangle
25th May 2017, 10:19 PM
Manik Tafralian
Manik Tafralian - avatar