Sail E0 Webinar
Question
What is the output of this C code (on a 32-bit machine)?
int main()
{
int x = 10000;
double y = 56;
int *p = &x;
double *q = &y;
printf("p and q are %d and %d", sizeof(p), sizeof(q));
return 0;
}
Options:
A .  p and q are 4 and 4
B .  p and q are 4 and 8
C .  Compiler error
D .  p and q are 2 and 8
Answer: Option A


Size of any type of pointer is 4 on a 32-bit machine.
Output:
$ cc pgm6.c
$ a.out
p and q are 4 and 4



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers