Discussion :: C-MCQs
-
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;
}
Answer : Option A
Explanation :
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
Be The First To Comment