Question.6
A developer checks if two sensor readings are equal:
int temp1 = 25, temp2 = 25; int *p1 = &temp1, *p2 = &temp2; if (p1 == p2) { printf("Equal"); } else { printf("Not equal"); }
Both variables hold 25. What is the output?
Select Answer
Equal — both point to the value 25
Not equal — the pointers compare addresses, not values, and temp1 and temp2 are at different addresses
Compilation error — pointers cannot be compared with ==
==
Equal — the compiler merges variables with the same value