Where i can change in the printk function,so that i will get the sum of that level..?

Hello @shubhankar1996.dob1 your approach is nor correct :
i have made the change in your code now it is working but now it is not giving the correct result because your approach is not correct.


this is your code which is producing wrong answer.
Here for your rference i am attaching the correct code:

if you have any doubt you can ask here:
Happy Learning!!