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.581Hard

What is the output of this code? char str[] = "GATE"; char *p = str; printf("%c %c", *p, *(p+3));

Q.582Easy

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

Q.583Easy

What will be the output of sizeof(union test) if union has members: int a, char b, float c?

Q.584Easy

Which keyword is used to define a structure in C?

Q.585Easy

What is the size of the following structure? struct point { int x; int y; float z; };

Q.586Easy

Can we pass a structure variable to a function in C?

Q.587Medium

What happens when you initialize a structure variable without assigning values?

Q.588Medium

Which of the following correctly declares a pointer to a structure?

Q.589Medium

What is the difference between struct and typedef struct?

Q.590Medium

What will be printed? struct s { int a; char b; int c; }; printf("%lu", sizeof(struct s));

Q.591Medium

How do you access a member of a structure using a pointer?

Q.592Medium

What is the purpose of padding in structures?

Q.593Medium

Consider: union u { int x; double y; }; What is sizeof(u)?

Q.594Hard

Which statement is true about nested structures in C?

Q.595Hard

What happens if you assign a union member and then access another member? struct u { int a; char b; }; u.a = 257; printf("%d", u.b);

Q.596Hard

How can you initialize a structure array of 10 elements partially in C?

Q.597Hard

What is the difference between self-referential and recursive structures?

Q.598Hard

Given union test { int x; char y[4]; }; If you set y[0]=65, y[1]=66, what happens to x?

Q.599Easy

Which of the following is a key difference between struct and union in C?

Q.600Easy

What will be the output of sizeof() for the following union? union data { int a; float b; double c; }

C Programming MCQs & Practice Tests – Free | iGET | iGET