Https://ide.codingblocks.com/s/253718

why its giving wrong output

@Aditya-Kushwaha-914550392281281
There are few mistakes in your code

  1. After printing any element, you also have to print comma (", "). So change line 8,13,18 and 26.
  2. line 18 should be cout<<a[i][endcol]<<", ";
  3. line 12 to 29 should be inside while loop. You have write it outside while loop.

@Aditya-Kushwaha-914550392281281
I have made changes in your code and it’s working fine now.

@Aditya-Kushwaha-914550392281281
As I can see you got 100 points for this question. Please mark this doubt as resolved.