if i comment line no 48 then code is working fine
but if i include line no 48 then giving error
it should not even matter ???
why line no 48 is creating problem ???
What is the problem in this code
hello @anujsharmabadboy
are u asking about n=n->next?
ye that line may produce segmentation fault ,in case n is itself NULL
no, no n=n->next is not what i am asking about
as i have printed after loop, n is 0 or null
why cant that value be assigned to c ??
why is c=n statement craeting error
u can assign c=n.
its ur print function that is creating issue.
in line 26 make it while(head!=NULL)
also remove if statement written after the while loop