Below are the interview questions for C language. These compilation is mostly from the interview questions asked in Microsoft, TCS, Wipro, Cognizant, Tech Mahindra, Satyam, L&T Infotech.
C Language Interview Questions.
1. Which key word is used to perform unconditional branching?
2. What are the differences between new and malloc?
3. What is a pointer?
4. What is the purpose of realloc()?
5. What are the different ways of passing parameters to the functions? Which to use when?
6. What is cyclomatic complexity?
7. In header files whether functions are declared or defined?
8. Difference between arrays and linked list?
9. What are enumerations?
10. Which control loop will used to execute set of statements for fixed number of times?
11. Is 0ab a valid octal number?
12. Can we use a C keyword as macros name?
13. What are the advantages of using Unions?
14. What is a nested structure?
15. What is recursion?
16. Does a break is required by default case in switch statement?
17. Define a structure.
18. What is lvalue and rvalue?
19. What is a static variable?
20. What is the purpose of main() function?
21. What is static memory allocation?
22. To make pointer generic for which date type it need to be declared?
23. What are library Functions?
24. What is the output of printf(“%d”)?
25. What it the return value of a relational operator if it returns any?
26. What are the uses of a pointer?
27. What is the purpose of #undef preprocessor?
28. Which operator can be used to determine the size of a data type or variable?
29. Which built-in library function can be used to re-size the allocated dynamic memory?
30. When should we use the register storage specifier?
31. What is the difference between arrays and pointers?
32. Can I include other file in place of .h with #include?
33. What does static variable mean?
34. what is ternary operators?
35. What is a NULL Macro?
36. How does bitwise operator XOR works.
37. Where the address of operator (&) cannot be used?
38. Can the main() function left empty?
39. What is an infinite loop?
40. Can we use the preprocessor operator ?defined? as macros?
41. Difference between Strings and character arrays?
42. Is there a way to compare two structure variables?
43. What is keyword auto for?
44. Why Preincrement operator is faster than Postincrement?
45. What is a string length?
46. What is the difference between actual and formal parameters?
47. What is a structure?
48. What is a preprocessor?
49. Can a function return multiple values to the caller using return reserved word?
50. What is the problem with the following coding snippet?
51. What is the differentiate between for loop and a while loop? What are it uses?
52. Is FILE a built-in data type?
53. How do declare an array?
54. Where are the auto variables stored?
55. What is typedef and why it is used?
56. What are the characteristics of arrays in C?
57. What are macros?
58. What is the default function call method?
59. What does include do?
60. What are the different types of Storage classes?
61. What is the purpose of extern storage specifier?
62. What is a token?
63. Can we use just the tag name of structures to declare the variables for the same?
64. Where an automatic variable is stored?
65. Can one function call another?
66. What is a constant pointer?
67. What is reminder for 8.0 % 2?
68. What is typecasting?
69. Can we assign a float variable to a long integer variable?
70. What is C language?
71. What is the maximum length of an identifier?
72. What is a dangling pointer?
73. What is the difference between a string copy (strcpy) and a memory copy (memcpy)?
74. How to close the file stream.
75. What is the advantage of declaring void pointers?
76. What is a NULL statement?
77. Which operator is used to receive the variable number of arguments for a function?
78. What is the difference between variable declaration and variable definition?
79. what is the difference between c &c++?
80. What are the advantages of the functions?
81. Where does global, static, local, register variables and C Program instructions get stored?
82. Can a program be compiled without main() function?
83. What is a NULL pointer?
84. how to append one string to another?
85. Explain the purpose of the function sprintf().
86. What are the types of C intructions?
87. Which are 2 types of macros?
88. What is a pointer on pointer?
89. What is the difference between #include? ? and #include ? ??
90. How to clear the allocated memory in C?
91. What is a pointer to a function?
92. What is ?this?s pointer?
93. What is the purpose of stricmp() function.
94. Where the keyword break can appear.
95. Which compiler switch to be used for compiling the programs using math library with gcc compiler?
96. Which operator is used to continue the definition of macro in the next line?
97. What are the techniques you use for debugging?
98. Which function can be used to release the dynamic allocated memory?
99. How to define and initialize an array in C?
100. What is the difference between const char*p and char const* p?
101. Where to store a negative integer?
102. What is the purpose of the keyword typedef?
103. What is the default value of local and global variables?
104. What are the advantages of using pointers in a program?
105. what is ‘stdin’.
106. What is the difference between a NULL Pointer and a NULL Macro?
107. What is the best way to define an identifier?
108. What are valid operations on pointers?
109. C is successor of which programming language?
110. What is static identifier?
111. What is recursion?
112. What are command line arguments?
113. Can variables belonging to different scope have same name? If so show an example.
114. What is the difference between arrays and pointers?
115. What is a pointer value and address?
116. What is a static function?
117. What is the meaning of base address of the array?
118. How can we determine whether a file is successfully opened or not using fopen() function?
119. What is difference between Structure and Unions?
120. Difference between static memory allocation and dynamic memory allocation?
121. Can a pointer access the array?
122. how to run while loop for specific time.
123. What is a constant?
124. Including the header file with-in angular braces < > and double quotes “ “ does makes a difference?
125. What are the differences between malloc() and calloc()?
126. Explain the syntax for for loop.