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

In C, which of the following statements about pointers is TRUE?

Q.22Medium

What will be the output of the following code? #include <stdio.h> int main() { int x = 10, y = 20; int *p = &x, *q = &y; *p = *q; printf("%d %d", x, y); return 0; }

Q.23Medium

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

Q.24Medium

Which of the following is NOT a valid data type modifier in C?

Q.25Easy

What will be printed by the following code? #include <stdio.h> int main() { char str[] = "Hello"; printf("%c", str[1]); return 0; }

Q.26Hard

What is the main difference between #define and const in C?

Q.27Hard

Which of the following correctly declares a function pointer?

Q.28Medium

Which memory segment stores global variables in C?

Q.29Easy

What is the output of the following code? #include <stdio.h> int main() { char c = 'A'; printf("%d", c); return 0; }

Q.30Hard

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

Q.31Medium

In C, what is the purpose of the 'static' keyword when used with a global variable?

Q.32Easy

Which of the following is the correct syntax to declare a pointer to an integer in C?

Q.33Easy

What is the size of 'char' data type in C?

Q.34Easy

Which of the following variable names is valid in C?

Q.35Easy

What is the default return type of the main() function in C?

Q.36Easy

Which escape sequence is used to print a newline character in C?

Q.37Medium

What is the range of values for 'signed char' in C (assuming 8-bit char)?

Q.38Medium

What will be the output of the expression: in C (considering integer division)?

Q.39Medium

Which of the following correctly represents a string literal in C?

Q.40Medium

What is the primary purpose of the 'volatile' keyword in C?