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.301Medium

In a nested structure, how do you access the innermost member? struct outer { struct inner { int value; } in; } obj;

Q.302Medium

Which of the following correctly initializes a structure array? struct point { int x, y; } arr[3] = ?

Q.303Medium

What happens when you modify a union member that overlaps with another?

Q.304Medium

Which statement is correct about bit fields in structures?

Q.305Medium

What is the difference between struct tag and struct type in C?

Q.306Medium

What will be the behavior of this code? struct s { int a; }; struct s obj = {5}; struct s *ptr = &obj; ptr->a = 10; printf("%d", obj.a);

Q.307Medium

Which initialization method for structures is used in designated initializers (C99 feature)?

Q.308Medium

How much memory (in bytes) will the following structure occupy on a 32-bit system? struct Data { char c; int i; short s; };

Q.309Medium

What is the primary difference between passing a structure by value vs by pointer in function calls?

Q.310Medium

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.311Medium

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

Q.312Medium

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

Q.313Medium

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

Q.314Medium

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

Q.315Medium

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

Q.316Medium

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

Q.317Medium

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

Q.318Medium

What happens if you attempt to assign one structure variable to another of the same type?

Q.319Medium

Which of the following is a valid declaration of nested structure?

Q.320Medium

What is the primary advantage of using unions in embedded systems?