2D array wave print

1.) in for loop it work fine if i change cout from a[i][j] to a[j][i] but show wrong output at a[i][j] why?? I just figured out correct ans by making random changes in for loop

2.) and also check for while loop.

question :- https://online.codingblocks.com/app/player/189104/content/180062/6885/lecture

code:- https://ide.codingblocks.com/s/445975

hello @dasvishal60

check now->

check for while loop also

check now->

1 Like

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.