-
-
-
-
-
-
-
}
">Viii) main(){ char *p; printf("%d %d ",sizeof(*p),sizeof(p));}
1 2Explanation:The sizeof() operator gives the number of bytes taken by its operand. P is a character pointer, which needs one byte for storing its value (a character). Hence sizeof(*p) gives a value of 1. Since it needs two bytes to store the address of the character pointer sizeof(p) gives 2.
-
-
printf(" %d", sizeof(u.a));
// printf("%d", sizeof(u.a[4].i));
}
">Union u{ union u { int i; int j; }a[10]; int b[10];}u;main(){ printf("n%d", sizeof(u)); printf(" %d", sizeof(u.a));// printf("%d", sizeof(u.a[4].i));}
A) None of the AboveB) 1, 100, 1C) 40, 4, 4D) 4, 4, 4Explanation: 20, 200, error for 3rd printf
-
What would be the output of the following program? main() { int i=4; switch(i) { default: printf("n A mouse is an elephant built by the Japanese"); case 1: printf(" Breeding rabbits is a hair raising experience"); break; case 2: printf("n Friction is a drag"); break; case 3: printf("n If practice make perfect, then nobody's perfect"); } }
A) a) A mouse is an elephant built by the Japanese B) b) Breeding rabbits is a hare raising experience C) c) A mouse is an elephant built by the Japanese Breeding rabbits is a hare raising experienceD) d) None of the above
-
-
-
-
-
-
-
-
-
-
}
plz simplify the statement the 2 .when i run program gives undefined symbol p..but in a/c mcq that is correct ..say collect address of i ..how?? ">1)what is RTTI in c++?2)main(){ int i=10; int &p=i; //statement 2printf("%d %d"i,p);}plz simplify the statement the 2 .when i run program gives undefined symbol p..but in a/c mcq that is correct ..say collect address of i ..how??
C Interview Questions
Ans