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
In C, which of the following statements about pointers is TRUE?
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; }
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; }
Which of the following is NOT a valid data type modifier in C?
What will be printed by the following code? #include <stdio.h> int main() { char str[] = "Hello"; printf("%c", str[1]); return 0; }
What is the main difference between #define and const in C?
Which of the following correctly declares a function pointer?
Which memory segment stores global variables in C?
What is the output of the following code? #include <stdio.h> int main() { char c = 'A'; printf("%d", c); return 0; }
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; }
In C, what is the purpose of the 'static' keyword when used with a global variable?
Which of the following is the correct syntax to declare a pointer to an integer in C?
What is the size of 'char' data type in C?
Which of the following variable names is valid in C?
What is the default return type of the main() function in C?
Which escape sequence is used to print a newline character in C?
What is the range of values for 'signed char' in C (assuming 8-bit char)?
What will be the output of the expression: in C (considering integer division)?
Which of the following correctly represents a string literal in C?
What is the primary purpose of the 'volatile' keyword in C?