iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.41Easy

Consider union u { int i; char c; float f; }; What is the size of this union?

Q.42Medium

What will be the output of this code? union Data { int x; char y; }; Data d = {65}; d.y = 'A'; printf("%d", d.x);

Q.43Easy

Which of these is a valid declaration of a structure variable using dot operator immediately after struct definition?

Q.44Medium

What is the issue with bit fields in structures regarding portability?

Q.45Hard

In a structure with flexible array members, which statement is INCORRECT? struct FlexArray { int len; int arr[]; };

Q.46Medium

What happens when you access a union member that wasn't the last one to be written?

Q.47Easy

Which of the following correctly demonstrates self-referential structure (for linked list)?

Q.48Hard

What is the output of the following? struct S { int a:3; int b:3; int c:3; }; printf("%zu", sizeof(struct S));

Q.49Medium

When comparing nested structures, which access method is INVALID? struct Address { char city[20]; }; struct Person { Address addr; }; Person p;

Q.50Medium

Which structure feature is most suitable for implementing a state machine with limited states?

Q.51Medium

What is the primary use case for unions in embedded systems?

Q.52Easy

When structure is passed by value to a function, which of these is true?

Q.53Easy

What is the correct way to dynamically allocate an array of structures? struct Student { int roll; char name[50]; };

Q.54Hard

In competitive programming, when should you use union instead of struct?

Q.55Hard

What will be the output of this code? struct X { int a; float b; }; struct Y { struct X x; int c; }; printf("%zu", sizeof(struct Y));

Q.56Medium

What is the size of the following structure on a 32-bit system? struct Point { char c; int x; };

Q.57Easy

Which of the following statements about unions is correct?

Q.58Easy

Consider: union Data { int i; float f; char c; }; What is the size of this union?

Q.59Medium

Which feature of structures makes them suitable for implementing linked lists?

Q.60Easy

How do you access a member of a structure through a pointer in C?