πŸ“Š C Programming
Q. What will be output if you will compile and execute the following c code?
Code:
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf(“%d %d %d”,s.p,s.c,s.m);
}
  • (A) 2 -6 5
  • (B) 2 -6 1
  • (C) 2 2 1
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2 2 1

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
219
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
96%
Success Rate