Regarding wrong output


sir I am getting a wrong output in this program
can you please check

Hi @sraj39273
refer this https://ide.codingblocks.com/s/625068

image
2 errors in ur code…

  1. pass head by reference in buildlist function.
  2. this cout<<“NULL” statement is not required as it is unnecessarily printing NULL which is not expected in o/p.
    ur corrected code --> https://ide.codingblocks.com/s/625371

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.