C C++

Home/Tag:C C++

C & C++ Interview Questions and Answers

(1) What will be output if you will compile and execute the following c code? struct marks { int p:3; int c:3; }; void main(){ struct marks s={2,-6}; printf(“%d %d”,s.p,s.c); } (a) 2 -6 (b) 2 1 (c) 2 2 (d) Compiler error Answer: (c) Explanation: Binary value of 2: 00000010 (Select three two bit) [...]