x

C Interview Questions

C interview questions are given with the answers in this website. We have given C interview questions faced by freshers and experienced in real interviews in IT industries. Users are welcome to suggest or add any other questions and answers related to C interview questions. Click on each question below to get the answers.


C interview questions and answers:

  1. What is C language?
  2. Who developed C language?
  3. Describe about history of C programming language.
  4. Where is C programming language used or uses of C language?
  5. What is the difference between C and C++?
  6. What is the difference between top down approach and bottom up approach in programming languages?
  7. What is the difference between C and Java?
  8. C language has been developed in which language?
  9. Which year C language is developed?
  10. What is meant by programming language and give some examples?
  11. Describe about C standards.
  12. What are the key features of C language or what are the characteristics of C language?
  13. What is embedded C?
  14. Which level is C language belonging to?
  15. What do you mean by high level, middle level and low level languages and give an example for each?
  16. What is the difference between structured oriented, object oriented and non-structure oriented programming language?
  17. What is compiler?
  18. What is the difference between assembler, compiler and interpreter?
  19. What is printf()?
  20. What is scanf()?
  21. What is meant by protocol?
  22. Execution of a C program starts from which function?
  23. What are all the sections that a C program may have and must have?
  24. What is IDE?
  25. List out some of C compilers.
  26. What is header file in C language?
  27. Is C language case sensitive?
  28. What is Macro? Why do we use macro?
  29. What is data type in C?
  30. What is the difference between int, char, float and double data types?
  31. What is the use of sizeof() function in C?
  32. What is modifier in C?
  33. What are different types of modifiers in C?
  34. What is enum in C?
  35. What is void in C?
  36. What is token in C?
  37. What are the types of C tokens?
  38. What is identifier in C?
  39. What is keyword in C?
  40. List out some keywords available in C language.
  41. What is constant in C?
  42. What are the types of constants in C?
  43. What is variable in C?
  44. What is the difference between constant and variable in C?
  45. Can variable name start with numbers?
  46. What is the difference between variable declaration and variable definition in C?
  47. What are the different types of variable in C?
  48. What is local variable in C?
  49. What is global variable in C?
  50. What is environment variable in C?
  51. What is operator in C?
  52. What are the different types of operator in C?
  53. What is the syntax for ternary operator in C?
  54. What is arithmetic operator in C?
  55. What is assignment operator in C?
  56. What is the relational operator in C?
  57. What is the logical operator in C?
  58. What is the bitwise operator in C?
  59. What are all decision control statements in C?
  60. What are all loop control statements in C?
  61. What is the difference between while and do-while loops in C?
  62. What is the difference between single equal “=” and double equal “==” operators in C?
  63. What is the difference between pre increment operator and post increment operator?
  64. What is the difference between pre decrement operator and post decrement operator?
  65. What is “&” and “*” operators in C?
  66. What will happen if break statement is not used in switch case in C?
  67. Why is default statement used in switch case in C?
  68. What is the use of “goto” statement?
  69. What value will be assigned to the variable X if a = 10, b = 20, c = 30, d = 40 for the expression X = a/b+c*d-c?
  70. What is the value assigned to the following variables? int X1 = 13/3; int X2 = 13%3;
  71. What is the difference between auto variable and register variable in C?
  72. What is the difference between auto variable and static variable in C?
  73. Where should type cast function not be used in C?
  74. How many arguments can be passed to a function in C?
  75. What is static function in C?
  76. If you want to execute C program even after main function is terminated, which function can be used?
  77. Is it possible to call atexit() function more than once in a C program?
  78. What is exit() function in C?
  79. What is the difference between exit() and return() in C?
  80. What is the use of “#define” in C?
  81. What is the syntax for comments in C?
  82. What is “##” operator in C?
  83. What is pragma in C? Or how will you execute functions before and after main function in C program?
  84. How will you override an existing macro in C?
  85. How to check whether macro is defined or not in a C program?
  86. What is the difference between memcpy() and strcpy() functions in C?
  87. What is the difference between memcpy() and memmove() functions in C?
  88. Is there any inbuilt library function in C to remove leading and trailing spaces from a string? How will you remove them in C?
  89. What is the difference between strcpy() and strncpy() functions in C?
  90. Can array subscripts have negative value in C?
  91. What is the difference between array and string in C?
  92. What is pointer in C?
  93. What is null pointer in C?
  94. What is NULL in C?
  95. What is void pointer in C?
  96. What is dangling pointer in C?
  97. What is wild pointer in C?
  98. What is file pointer in C?
  99. When can void pointer and null pointer be used in C?
  100. What is const pointer in C?
  101. Is pointer arithmetic a valid one? Which arithmetic operation supposed to be not valid in pointer? Why?
  102. Is void pointer arithmetic a valid one? Why?
  103. What is the difference between null and zero?
  104. What is the difference between null pointer and uninitialized pointer in C?
  105. Can array size be declared at run time?
  106. What is memory leak in C?
  107. What happens when we try to access null pointer in C?
  108. What is meant by segmentation fault or memory fault in C?
  109. What is meant by core dump in C?
  110. Can a pointer be freed more than once in C? What happens if we do so? Or can a pointer be freed twice in C?
  111. What is the size of int pointer and char pointer in C?
  112. How will you print the value and address of a pointer variable (example int *p) in C?
  113. How will you print the value and address of a normal variable (example int p) in C?
  114. What are library functions and their use in C language? Can we write our own functions and include them in C library?
  115. Can variable name be start with underscore in C?
  116. Can variable name have special symbols in C?
  117. What is inline function in C?
  118. Is it possible to print “Hello World” without semicolon in C? How?
  119. What is the scope of local, global and environment variables in C?
  120. Why are we using pointers in C?
  121. What is static variable in C?
  122. What is extern and static function in C?
  123. What is the difference between pointer and array in C?
  124. Can a variable be both volatile and constant in C?
  125. What is the use of main() function in C?

More C interview questions:

There are so many C interview questions that could be expected from any interviews. We have given many C questions below. Users are requested to find out the answers from our C programming language tutorial to enrich your skills. But, users are always welcome to send the answers to the below questions by contacting us through the contact us form to help others or discuss in our C interview questions discussion Forum to get and share the best answers. Happy Learning!


  1. What is the difference between #include “stdio.h” and #include <stdio.h> in C?
  2. What is the difference between array and linked list?
  3. What is recursion function in C?
  4. What is the difference between static array and dynamic array in C?
  5. What is pointer to pointer in C?
  6. What is stream in C?
  7. How will you swap 2 variables without using temp variable in C?
  8. What is operator precedence in C?
  9. What is the size of int, char, float and double data types in C?
  10. What is truncation in C? When does it happen?
  11. What are the properties of structure in C?
  12. What are the properties of union in C?
  13. What is self-referential structure in C?
  14. What are advantages and disadvantages of using macro in C?
  15. What is the difference between auto and register keywords in C?
  16. What is the use of bit field in C?
  17. What is bus error in C?
  18. Is it possible to reduce executable file size in C and how?
  19. What is stack memory in C?
  20. What is heap memory in C?
  21. In which memory, local variables are stored in C?
  22. In which memory, malloc(), calloc() ( dynamic memory functions ) are stored in C?
  23. While passing an array to a function as an argument, what actually is passed?
  24. What is high order and low order bytes in C?
  25. What is the maximum number of arguments that can be passed to a function?
  26. What is header file in C?
  27. Do you know why is semicolon used at the end of each line in C programs?
  28. What is the difference between getc(), getch() and getchar() in C?
  29. How to change the size of an array dynamically in C?
  30. What is errno() in C?
  31. Is it possible to return more than one values from a function in C?
  32. Consider following return statement, return 5 7 9; which value will be returned to the calling function? Either 5 or 7 or 9?
  33. What is function prototype in C?
  34. What is the purpose of fflush() function in C?
  35. What is the use of extern keyword in C?
  36. Can modulus operator be applied to float or double data type in C? Answer – No
  37. What is the difference between normal variable and pointer variable in C?
  38. What are all different types of pointers in C?
  39. What are all format specifiers in C? Why are they used?
  40. What is linked list?
  41. What value will be assigned to X below if p = 5?
    X = *p++;
    X = ++ *p;
  42. What is hashing?
  43. What is static variable? Can static variable be declared in header file in C?
  44. Is it possible to have nested include files in C?
  45. What is the difference between printf() and sprintf() functions in C?
  46. What is linked list and circular linked list?
  47. What is the difference between character array and string in C?
  48. What is the difference between char const* p and const char* p in C language?
  49. What does implicit and explicit mean in C?
  50. What is the difference between enum and #define constant in C?
  51. What is alias in C?
  52. What are predefined macros in C language?
  53. Which one is executed faster than other? Why?
    n++;
    n+1;
  54. Can a file other than header file be included in C program using #include?
  55. Is error handling done in C? What are all error handling functions in C?
  56. What is array boundary check? Is it done in C?
  57. What is null pointer assignment error in C?
  58. Can we assign null to a pointer after freeing them in C?
  59. What is page thrashing in C?
  60. Is it possible to determine the size of an allocated portion of memory for a program in C?
  61. What is sorting and list all the sorting methods in C?
  62. What is searching and list all the searching methods in C?
  63. Which is the quickest sorting method?
  64. Which is the quickest searching method?
  65. When should type cast not be used in C?
  66. What is difference between function and built in function in C?
  67. What is difference between linker and linkage?
  68. Which one (nested if or switch statement) is easy to use when we have more than 2 conditional expressions in C?
  69. What is argument in C? What is the difference between actual argument and formal argument in C language?
  70. What is the difference between internal and external static variables in C?
  71. What is modular programming?
  72. What is indirection in C?
  73. What is the difference between array and pointer in C?
  74. How many ways a pointer variable can be initialized in C?
  75. What is difference between text and binary modes in C?
  76. What is difference between structure and union in C?
  77. What is difference between structure and array in C?
  78. Is function declared or defined in header files in C?
  79. Where is extern, static and auto variable stored in memory?
  80. Where is register variable stored in memory?
  81. What is difference between for loop and while loop in C?
  82. Which data type a pointer variable belonging to in C?
  83. What is array of pointer or pointer array in C?
  84. Can a C program have more than one main() function?
  85. Can a structure have a pointer to itself in C?
  86. What is file in C?
  87. What are the types of files in C?
  88. What is file pointer in C?
  89. What is the difference between array of pointer and pointer to array in C?
  90. What is fopen(), fclose() in C?
  91. What is ftell in C?
  92. What is difference between constant pointer and pointer to a constant in C?
  93. Can main() function be called recursively in C?
  94. Can we compare 2 same structures in C?
  95. What is difference between syntax error and logical error in C?
  96. Is it correct to include all header files in a C program?
  97. How will you print back slash character in C?
  98. What is the difference between single and compound statements in C?
  99. Is it possible to pass entire structure to a function in C? How?
  100. Is macro better than function in C programming?
  101. Is using goto statement a best practice in C programming?
  102. What is the difference between break and continue statement in C?
  103. True or false? C is not case sensitive.
  104. Which header file needs to be included in C program to use printf() and scanf() functions?
  105. What is the difference between gets() and fgets() in C?
  106. What is data type in C language?
  107. What are the basic data types in C language?
  108. Which is used to fine the size of variable, array in C? Answer – data type
  109. What is int, char and floating point in C?
  110. What is the storage size of long long int in 16 bit processor in C?
  111. What is the storage size of long long int in 32 bit processor in C?
  112. What is the syntax for enum in C?
  113. What are derived data types in C?
  114. What are the types of tokens in C?
  115. What is keyword in C?
  116. What is identifier in C?
  117. What are constants in C?
  118. What are the types of constants in C?
  119. What are all the ways a constant can be used in C programming?
  120. What is type qualifier in C?
  121. What are the types of qualifiers in C?
  122. What is const keyword in C?
  123. What is volatile keyword in C?
  124. What is storage class specifier in C language?
  125. What are the types of storage class specifiers in C?
  126. Can all variables stored in register memory for faster access?
  127. What is auto specifier in C?
  128. What is static specifier in C?
  129. What is extern specifier in C?
  130. What is register specifier in C?
  131. What is array in C?
  132. What are the different types of array in C language?
  133. How are data stored in 2 dimensional arrays in C?
  134. What is string in C language?
  135. What is the difference between strcat() and strncat() functions in C?
  136. Which string function can be used to compare two strings irrespective of the case in C?
  137. Can the content of a pointer be a string in C?
  138. What is the size of int pointer and char pointer in C?
  139. What is function in C?
  140. Why are functions used in C language?
  141. What is meant by function declaration, function call and function definition in C?
  142. How can we call a function in C program?
  143. What is call by value in C?
  144. What is call by reference in C?
  145. What is the difference between function declaration and function definition in C?
  146. Can a function be called either with or without arguments in C?
  147. When a function can return some value to the calling function in C program?
  148. When a function can’t return any value to the calling function in C program?
  149. Is it possible to return more than one value from a function in C program?
  150. What can be done if we want to return many values from a function in C program?
  151. What is library function or inbuilt function in C programming?
  152. What are the advantages of using library functions over writing our own functions in C program?
  153. What does each library function contain in C?
  154. All dynamic memory allocation functions are declared in which header file in C?
  155. Is exit() function declared in which header file in C?
  156. What is the difference between header file and precompiled version of header file in C?
  157. What is command line argument in C?
  158. How will you pass arguments to the main function in C?
  159. What is variable length argument in C?
  160. How is variable length argument denoted in C?
  161. Variable length argument functions are declared in which header file in C?
  162. Which function is must in a C program?
  163. How many times a function can be called in a C program?
  164. Is main function necessary in compilation time in C? Or Can we compile a program without main() function in C?
  165. Can we execute a program without main() function in C?
  166. What are the types of functions in C language?
  167. What is the output for the below?
    C = floor(5.7);
    C = ceil(5.7);
  168. Which header file supports abs() function in C?
  169. Which library function is used to check whether character is alphabetic or not?
  170. Which library function is used to check whether character is alphanumeric or not?
  171. What is buffer manipulation function in C?
  172. Which function is used to modify system date in C?
  173. Which function is used to get current system time in C?
  174. What is dynamic memory allocation in C?
  175. What are the dynamic memory allocation functions in C?
  176. What is malloc() in C?
  177. What is calloc() in C?
  178. What is realloc() in C
  179. What is free() in C?
  180. What is the difference between malloc() and calloc() function in C?
  181. What happens if you try to allocate memory for the same pointer variable twice using malloc() function in C?
  182. What happens if you try to free the memory for the same pointer variable twice that was allocated using malloc() function in C?
  183. What is the difference between static memory allocation and dynamic memory allocation in C?
  184. What is type casting in C?
  185. How will you convert string into integer or float in C?
  186. How will you convert integer into string in C?
  187. What is structure in C?
  188. What is member in a C structure?
  189. How can we access structure members in C?
  190. Can you copy one structure into another in C? How?
  191. What is the difference between variable, array and structure in C?
  192. What are the uses of structures in C?
  193. What is array of structure or structure array in C?
  194. Ca we have more than one structure variable declared for one structure in C?
  195. What is nested structure in C?
  196. How are structure members stored in memory?
  197. What is structure padding in C?
  198. How to avoid structure padding in C?
  199. Why is structure memory size not always same as we expected?
  200. What is typedef in C?
  201. What is union in C?
  202. What is pre-processor and pre-processing in C?
  203. What is pre-processor directive in C?
  204. What are pre-processor, compiler, assembler, linker and loader?
  205. What are source code, expanded source code, assembly source code, object code and executable code?

Prev     Next



Like it? Please Spread the word!