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

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

Q.662Easy

In C, what does the 'typedef' keyword do when used with structures?

Q.663Medium

Consider a structure with bit fields: struct Flags { unsigned int flag1 : 1; unsigned int flag2 : 3; unsigned int flag3 : 4; }; What is the minimum size of this structure?

Q.664Medium

What will happen if you try to compare two structures using the == operator directly?

Q.665Easy

Given: struct Node { int data; struct Node *next; }; This represents which data structure concept?

Q.666Easy

In the context of structures, what does 'self-referential' mean?

Q.667Medium

Which of the following is a valid way to pass a structure to a function?

Q.668Medium

In a nested structure scenario like struct A contains struct B, how do you access a member of B from A's variable?

Q.669Medium

What is the purpose of using anonymous structures/unions?

Q.670Medium

Consider this structure: struct Complex { int real; int imag; }; If you want to create an array of 100 such structures, which declaration is correct?

Q.671Hard

What is the output of this complex code? struct S { char c; int i; } s; printf("%lu", sizeof(s));

Q.672Hard

In competitive programming, when you need a structure that can hold either an integer or a floating-point number (but not both simultaneously) in the most memory-efficient way, which should you use?

Q.673Easy

What is the key difference between a structure and a union in C?

Q.674Medium

Consider the following code: struct Data { int x; char y; double z; }; Assuming int=4 bytes, char=1 byte, double=8 bytes, what is the size of struct Data due to padding?

Q.675Medium

Which feature in C allows you to define a structure without a tag name for use within another structure?

Q.676Hard

What will be the output of the following code? union Test { int a; char b; }; union Test t; t.a = 65; printf("%d %c", t.a, t.b);

Q.677Medium

In the context of bit fields in structures, what is the maximum number of bits that can be allocated to a single member in standard C?

Q.678Easy

struct Node { int data; struct Node *next; }; This is an example of which design pattern?

Q.679Medium

Which of the following statements about structure initialization in C is INCORRECT?

Q.680Easy

Given a structure with array members, how would you efficiently pass it to a function to avoid copying overhead?