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.1Easy

Which of the following is the correct syntax to declare a variable in C?

Q.2Easy

What does the following code snippet output? #include <stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }

Q.3Medium

Which of the following is NOT a valid C keyword?

Q.4Easy

What is the output of: printf("%d", 5 + 3 * 2)?

Q.5Medium

Which of the following is the correct way to define a constant in C?

Q.6Easy

What is the purpose of the main() function in C?

Q.7Hard

What will be the output of: int x = 10; printf("%d %d", x, x++);

Q.8Easy

Which escape sequence represents a tab character in C?

Q.9Medium

What is the return type of strlen() function?

Q.10Medium

Consider: void func(int *p); Which statement is correct about this function declaration?

Q.11Medium

What will happen if we try to modify a const variable in C?

Q.12Medium

Which of the following correctly represents a character constant in C?

Q.13Hard

Consider the expression: int arr[5]; What does arr represent without the index?

Q.14Medium

What is the output of: printf("%f", );

Q.15Hard

Which storage class has a default value of 0 if not explicitly initialized?

Q.16Hard

What will be the output of the following code? #include <stdio.h> int main() { int x = 5; printf("%d", ++x + x++); return 0; }

Q.17Medium

What is the size of the following structure in bytes (assuming 32-bit system)? struct Point { char c; int x; double d; }

Q.18Medium

What will be printed by the following code? #include <stdio.h> int main() { float f = 0.1 + 0.2; if(f == 0.3) printf("Equal"); else printf("Not Equal"); return 0; }

Q.19Easy

Which keyword is used to create a variable that cannot be modified after initialization?

Q.20Easy

What is the output of the following code? #include <stdio.h> int main() { int arr[] = {10, 20, 30}; printf("%d", *(arr + 1)); return 0; }