CSE MCQs :: 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;
} - Which is correct with respect to size of the datatypes?
-
What is the output of the following C code(on a 64 bit machine)?
union Sti
{
int nu;
char m;
};
int main(){
union Sti s;
printf("%d", sizeof(s));
return 0;
} -
What is the output of this C code?
int main()
{
float x = 'a';
printf("%f", x);
return 0;
} - In a 32-bit compiler, which 2 types have same size?
- Loss in precision occurs for typecasting from____________.
-
For union
union temp
{
char a;
int b;
float c;
};
The size is decided by: