Top 10 C language Interview Question and Answer
Authored By: Ankita Prajapati
C Language is a general-purpose computer programming language. It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential. By design, C’s features cleanly reflect the capabilities of the targeted CPUs. You must understand the basics of C Language to secure a job related to it. Read the top C Language Interview Question and Answers.
Question 1: What do you mean by Dangling Pointer variable in C programming?
Answer: In C programming, a pointer is used to identify a variable’s location in memory. The term “dangling pointer variable” refers to a pointer variable that has been erased yet the pointer is still referring to the same position in memory.
Question 2: What do you mean by the scope of the variable? What is the scope of the variables in C?
Answer: The portion of the code where variables stated in the program can be directly accessible is referred to as the variable’s scope. All identifiers in C have lexical (or statically) scoped definitions.
Question 3: What are static Variables and Functions?
Answer: Static variables and static functions are those that have the keyword “Static” in their declarations. The scope of variables declared with the Static keyword is limited to the function in which they are used.
Level up your skills and Join Developers Zone India Community
Join Engineering Communities and Events related to your Career Path.

Question 4: Differentiate between calloc() and malloc()?
Answer: The memory dynamic memory allocating routines calloc() and malloc(). The sole distinction between them is that malloc() will not load a value into any of the designated memory addresses, but malloc() would.
Question 5: What are the valid places where the programmer can apply the Break Control statement?
Answer: A loop and a switch control statement can both contain a break control statement.
Question 6: Differentiate between Actual Parameters and Formal Parameters.
Answer: Actual parameters are those that are transmitted from the main function to the subdivided function, while formal parameters are those that are specified at the subdivided function conclusion.
Join the Global Developers Zone community and code your way to success!
Question 7: Can a C program be compiled or executed in the absence of a main()?
Answer: Although the software won’t be run, it will be compiled. Any C program must have a main() to run.
Join Engineering Communities and Events related to your Career Path.

Question 8: What do you mean by a Nested Structure?
Answer: A structure is referred to as being nested when a data member from one structure is used to refer to a data member from another function.
Question 9: What is Preprocessor?
Answer: A built-in predefined function or macro known as a preprocessor directive serves as a directive to the compiler and is executed before the execution of the real C program.
Take your career to new heights by joining our Career Building & Advancement community
Question 10: What are the basic Datatypes supported in C programming Language?
Answer: In general, there are four categories used to group datatypes in the C language. These are what they are:
- Simple Datatypes
- Descendant Datatypes
- Types of Enumerated Data
- Virtual Datatypes
Data type name | Data type size | Data type range |
Datatype Name | Datatype Size | Datatype Range |
short | 1 byte | -128 to 127 |
unsigned short | 1 byte | 0 to 255 |
char | 1 byte | -128 to 127 |
unsigned char | 1 byte | 0 to 255 |
int | 2 bytes | -32,768 to 32,767 |
unsigned int | 2 bytes | 0 to 65,535 |
long | 4 bytes | -2,147,483,648 to 2,147,483,647 |
unsigned long | 4 bytes | 0 to 4,294,967,295 |
float | 4 bytes | 3.4E-38 to 3.4E+38 |
double | 8 bytes | 1.7E-308 to 1.7E+308 |
Long double | 10 bytes | 3.4E-4932 to 1.1E+4932 |
Deep dive into Engineering, Join millions like you
