Print star triangle using swift

Posted by Editorial Staff | Updated on

In this answer, we have shared how to print star triangle using swift program. Not quite equilateral but as close as you’re likely to get with character graphics. The main things are that you need an odd number of asterisks on each line for centering to work and you need to calculate an offset.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers