Pascal Triangle | Sololearn: Learn to code for FREE!


Pascal Triangle

Can anyone fix this program! Desktop: working fine on me ;) Mobile editor: working first column on me :l Sololearn: working first row on me, haha Why this program behaving abnormally? Or this is any logic mistake?

1/10/2021 5:56:52 PM

Kashyap Kumar

3 Answers

New Answer


Increase the array size at #define MAX to say 50 and it should work


It's a case of overflow say size of declared array is less as far as the n (number here 5) needs so it garbage value is associated to the index where there's insufficient memory. Unlike java we don't have array outofbound exception so it's improper to rename it.. but yes the concept is same. //I may be a bit incorrect 🤷‍♂️


Aditya yeah working now, can you tell me the reason why it's not working with the value 10