This code is of printing all level node of tree please check why it is not giving the output?

there is mistake in printKth() function, you haven’t write return; in base case. Just add return; after line 42. Also line 45 should be printkth(root->right, j-1); correct it. there is one more mistake in line 50, it should be for(int j=1;j<=h;j++) not h++.
make these changes your code will work fine

I see you got 100 points. I am marking it as resolved.

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.