Pattern Pseudocode

sir, i did’nt understand how 5 and 6 were incremented in 3 row of pattern at 7:24 time in the video

Hey @AkshayBannatti
Are u talking about this pattern
1
2 3
4 5 6
7 8 9 10

So here observe few things

  • If input is N then there are N rows so this means one loop will run N times (A)
  • For ith row it has i elements ,so inner loop runs i times (B)
  • You are printing same variable after incrementing it ©
var=1                    //C
for row=1 to row<=N       //A 
      for col=1 to col<=row       //B
               print(var)     
               var+=1;
      print("\n") //changing line after printing current row.

yes sir pattern is
1
2 3
4 5 6

Sir i understood the algorithm but i did’nt understand how it was incremented from 4 to 5 and 5 to 6

Bro we are using var variable for that ,and its inside inner loop so for each iteration of inner loop var is incremented.

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.