Multiple choice

Fill in the blank in the following code, where DOM is counting the number of nodes in link list.
int DOM() {
struct NODE *M= First;
int count=0;
while( _____ ) {
++count;
P=P->next; }
return count;
}

  1. P

  2. !P

  3. P->next

  4. !P->next

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

If (P), then P is pointing to link list, where P is the first pointer. If (!P), then P is pointing to nothing. So, in the while condition, P is satisfying the condition.