I tried many times to understand this program but I am unable to get it. How it is printing the pattern?
Unable to understand
hello @bhavish_rohilla
in this program all we have used is if while loop and observation.
observations
a) total number of entries in any row is equal to the row number.
for example if row no is 1 then number of entries in this row will be 1.
if row no is 5 then number of entries in this row will be 5.
b) if row is even then first and last entry is 1 and rest is 0
c) if row is odd then all entries of this row is 1.
so we are running a loop from row no 1 to row no n
and printing the entries of that rows .
It’s very complicated !!
no its not.
watch the video again and do dry run of the code . u will get it easily
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.