Posted inUncategorized C Programming Language Interview Questions Quiz (Multiple Choice) Posted by Mr. AI October 16, 2025 Spread the love C Programming Language C Programming Language 1 / 25 Which of the following statements about pointers in C is true? Pointers store memory addresses Pointers store variable names Pointers store constant values Pointers store data types 2 / 25 What is the output of the following code: int a = 5; printf("%d", a++ + ++a); 11 10 Undefined behavior 12 3 / 25 Which of the following functions can dynamically allocate a 2D array in C? malloc() calloc() realloc() Both malloc() and calloc() 4 / 25 What is the correct way to declare a pointer to a function in C? int *func(); int (*func)(); int func*(); pointer func(); 5 / 25 What will be the output of sizeof('A') in C? 1 2 4 Depends on compiler 6 / 25 What is the output of printf("%d", sizeof(printf("hello"))); 5 6 4 or 8 depending on system Error 7 / 25 Which of the following is not a valid way to pass parameters in C? Pass by value Pass by reference Pass by pointer Pass by name 8 / 25 What is the result of the expression (1 << 3) in C? 2 4 8 16 9 / 25 Which of the following statements correctly describes static variables in C? They are initialized once and retain their value between function calls They are reinitialized each time a function is called They can only be declared globally They must be initialized manually 10 / 25 What will happen if you try to modify a string literal in C? It will be modified successfully Compilation error Runtime error (segmentation fault) Undefined behavior 11 / 25 What is the purpose of the 'volatile' keyword in C? To prevent variable modification To optimize memory access To indicate that the variable can be changed unexpectedly To store constants 12 / 25 Which of the following is true about 'enum' in C? It defines a new integer type It defines floating constants It cannot have duplicate values It can only store strings 13 / 25 What will be the output of: printf("%d", strcmp("abc", "abd")); -1 0 1 2 14 / 25 Which of these is used to prevent multiple inclusions of a header file? #include #ifndef #endif #pragma once 15 / 25 What is the output of the expression (5 & 3) in C? 1 3 5 7 16 / 25 Which of the following statements is correct about recursion in C? Recursion requires more memory due to stack usage Recursion is always faster than iteration Recursion never terminates Recursion does not use function calls 17 / 25 What does the 'extern' keyword indicate? A variable defined inside a function A global variable defined elsewhere A constant variable A temporary variable 18 / 25 Which of the following functions can be used to copy a string safely in C? strcpy() strncpy() memcpy() strcat() 19 / 25 What will be the result of 'printf("%d", 10 % 3);'? 1 2 3 0 20 / 25 What is the output of the following code? int x=5; printf("%d", x+++x); 10 11 Compilation error Undefined behavior 21 / 25 Which of the following describes a void pointer? A pointer with no associated data type A pointer to void functions only A null pointer A dangling pointer 22 / 25 What will happen if you free the same memory twice in C? Nothing Memory leak Undefined behavior Segmentation fault always 23 / 25 Which of the following statements about macros is correct? They are evaluated at runtime They are replaced during preprocessing They can take only integers They are stored in memory 24 / 25 Which of these can be used to terminate a program immediately? exit() break return continue 25 / 25 Which function is used to move the file pointer to a specific location in C? fseek() fmove() fread() fshift() Your score isThe average score is 12% 0% Restart quiz Mr. AI My name is Ram. I am a Data Scientist and Machine Learning expert with good knowledge in Generative AI. Working for a top MNC in New York city. I am writing this blog to share my knowledge with enthusiastic learners like you. View All Posts Post navigation Previous Post DSA (Data Structures and Algorithms) Interview Questions Quiz (Multiple Choice)