At 7:36 Why condition while(col<=row-2) is used
Please help
Why condition while(col<=row-2) is used
@aatish08 Please dry run with any example and check with the code. You will get it easily.
According to Prateek Bhaiya’s code, in an even row the leftmost and the rightmost element is 1…all elements in between are 0. So condition while(col<=row-2) is used to print all the 0s in between.
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.