What is the output of the following C code on a 32-bit machine? #include stdio.h> int main () int x = 10000; double y = 56; int *p = &x; double *q = &y; printf("p and q are percent d and percent d", sizeof(p), sizeof(q)); return 0;
A. p and q are 4 and 4 respectively.
B. p and q are 4 and 8 respectively.
C. compiler error
D. p and q are 2 and 8 respectively.
Answer:A
What is the output of the following C code on a 32-bit machine? #include stdio.h> int main () int x = 10000; double y = 56; int *p = &x; double *q = &y; printf("p and q are percent d and percent d", sizeof(p), sizeof(q)); return 0;
A. p and q are 4 and 4 respectively. B. p and q are 4 and 8 respectively. C. compiler error D. p and q are 2 and 8 respectively.
Explanation: On a 32-bit processor, the maximum size of any sort of pointer is 4. $ cc pgm6.c $ a.out p and q are 4 and 4