PASCAL TRIANGLE -1

CODE–https://ide.codingblocks.com/s/385470
QUES–https://hack.codingblocks.com/app/contests/1975/285/problem

hello @aaliyah_beg what is the problem that you are facing?

for n=4 tle is coming

hey @aaliyah_beg your code is giving TLE for 3 onwards.
even i dont think your approach is correct.
see this:


you have to just now print it in output format.
Happy Learning!!

sir , 2-D array hasnt been d
till now.So,without that we were to do this ques

Hello @aaliyah_beg then you should wait and do this question after the topic will be covered.

sir but why isnt my code correctly working .

Hey @aaliyah_beg the problem is in your while loop.
this you can prove by commenting your while loop.
this is why because when i=1 then the condition in the while loop is getting false and it is being executed.
but when i is greater then 2 then the same is not happening because the condition in the while loop is evaluating out to be true everytime.
this is the reason.
Happy Learning!!

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.