Actually , here p and q pointer is incrementing 1:3 manner. As p is incrementing very less than q , so, loop will exists when q coming back and address of q pointer will match with p pointer.
So, we can tell if there is no loop, q will go end of list first and will accept
q==NULL
and will terminate
Otherwise p and q both get a valid pointer value and keep moving.
So, only checking of q pointer will be sufficient and enough
Ans will be B)