Print all nodes at k

i am unable to find error in my code
but only 2 testcases are running succesfully

link to code : https://ide.codingblocks.com/s/297715