Code is not giving output

https://ide.codingblocks.com/s/214222 … it is not working for the question … I am not getting why … plz help asap

Hello @dhirenkinha,

I have corrected your code:


Refer to the comments for better understanding.

Hope, this would help.
Give a like if you are satisfied.

1 Like

https://ide.codingblocks.com/s/214261 … I did this again … but it is still showing compiling error

sir why are we using and operator … shouldn’t we use or

Hello @dhirenkinha,

You have not even read the correction i have made in your code previously.
There is a correction in the while loop of your previous code.
This is very sad that you don’t consider our replies seriously.

There is no other mistake in your code than this.

Hope, this would help.

sorry sir … i started making another code… that’s why … really sorry for that

No problem @dhirenkinha,

The reason to use and over or is:

When you use and, if any of condition comes false, the while loop terminates.
But in case of or, both the conditions need to be false to terminate the loop.

Here, the requirement is to terminate the execution of the loop if either temp becomes NULL or the next of temp is NULL.

Hope, this would help.

1 Like

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.