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

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

Q.62Medium

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

Q.63Medium

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

Q.64Hard

In a structure, what does the #pragma pack(1) directive do?

Q.65Easy

Which of the following correctly demonstrates a typedef for a structure?

Q.66Hard

If a structure contains a flexible array member, where must it be declared?

Q.67Medium

How can you create a structure that can hold either an integer or a floating-point number, but not both simultaneously?

Q.68Medium

What is the difference between 'struct' and 'typedef struct' in C?

Q.69Hard

In competitive programming, when implementing a graph using adjacency lists, which data structure is most suitable?

Q.70Medium

What will be the output if you read a union member that was not last written to?

Q.71Easy

Which of the following is the correct way to initialize a structure in C?

Q.72Hard

If you have a structure with bit fields, which statement about their behavior is true?

Q.73Medium

In a nested structure scenario, how do you access a member of the inner structure?

Q.74Easy

Which of the following statements about structures is TRUE?

Q.75Medium

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

Q.76Easy

Consider the following code: struct Data { int a; char b; }; struct Data d = {10, 'A'}; Which method of initialization is used here?

Q.77Easy

What is the primary difference between a struct and a union in C?

Q.78Medium

What will be the output of this code? union Data { int a; char b; }; union Data d; d.a = 257; printf("%d %c", d.a, d.b);

Q.79Easy

Which of the following correctly demonstrates accessing a member of a pointer to a structure?

Q.80Medium

What is the size of the following union? union Test { int a[5]; char b[10]; double c; }