Articles, Blog

Module 3 – Lesson 2 ► Drawing a Christmas tree on computer screen | Learn to code

August 14, 2019


This is a really fun program we are just
going to print this Christmas tree. So, because this has front slash and
backslash… okay, so in order to print this in the printf statement we will require a
single front slash and then two backslashes similarly, on the next line
will have two front slashes and four back slashes and so on… notice that we
are filling up the spaces as well. over here, like here here here and so on. So this is very simple program but I will encourage you to try drawing some random
figures on the output screen so that it will give you a brief idea… how console
outputs are generated. This knowledge will be very crucial at the time when we
are going to do pattern programming using FOR or WHILE loops

You Might Also Like

No Comments

Leave a Reply