Print Hollow Triangle Pattern using Loops | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Print Hollow Triangle Pattern using Loops

Input the number of lines ( variable 'n' ) to print the hollow triangle from user. e.g. If user gives 5, the program should print ####1 ###1#1 ##1###1 #1#####1 1#1#1#1#1 Note: Replace # with space(s) and every edge should have 'n' numbers of 1 or whatever symbol you like. Use only loop and conditions & input a variable n to print triangle for n lines.

25th Jul 2017, 8:42 AM
Kartikey Sahu
Kartikey Sahu - avatar
4 Answers
25th Jul 2017, 9:47 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 1
MAN i just realized that this doesn't work fine in mobile..... Thanks for the challenge. https://code.sololearn.com/WxtlCkHnyL9D/#js
16th Jan 2018, 8:57 AM
Ng Ju Ping
Ng Ju Ping - avatar
0
https://code.sololearn.com/c7m142pgG8n0/?ref=app.....i hadn't written comments but i hope this will help you
27th Jul 2017, 8:37 AM
Shashank Kesarwani
Shashank Kesarwani - avatar