Ven after odd problem in linked list section....please check thew code and tell why test case 3 and 4 failed

@imambujsingh08
your code will given segmentation fault for all such cases which have only odd numbers. This is because there is logical mistake in line no 38. here your program first check temp->next%2!=0 and then check temp!=NULL. So even if temp is NULL, your code check for temp->next which don’t exist and give segmentation fault.
So change line 38 with while(temp!=NULL && temp->data%2!=0)
All testcase will pass.

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.