Home › Interview Questions
WELCOME TO ENOSIS LEARNING

Technical Interview Questions & Answers Hub

Comprehensive collection of real-world interview questions, expert answers, code snippets, and interview preparation guides.

Real Interview Questions
Verified Answers
Downloadable Q&A PDF

c Interview Questions

Verified Technical Q&A • Career Prep Guide
Q1

What are the key features of C programming language?

Verified Answer
C is a platform-dependent language. C offers the possibility to break down a large program into small modules. Also, the possibility of a programmer to control the language. C comes with support for system programming and hence it compiles and executes with high speed when compared to other high-level languages.
Q2

What is the use of header files in C?

Verified Answer
Header files contain the definitions and set of rules of the functions being used in the programs. For example, when you use printf() or scanf() in your program, you nee to include stdio.h library function. Else your compiler will show an error. This is because, the standard input and output functions printf() and scanf() are stored in this header file. So similarly every header file stores a set of predefined functions which makes it easy to program.
Q3

What is Memory Leak in C?

Verified Answer
A memory leak occurs when programmers create a memory in the heap and forget to delete it. It decreases the efficiency of the performance of the system.
Q4

What is the difference between ++a and a++?

Verified Answer
‘++a’ is called prefix increment. First, the value stored in the variable ‘a’ gets incremented and then gets assigned to the same variable. Whereas, ‘a++’ is called postfix increment. The value stored in the variable ‘a’ gets incremented after the execution of the particular line.
Q5

What is a Dangling Pointer in C?

Verified Answer
A pointer pointing to a dereferenced memory location is called dangling pointer. i.e. pointer pointing to the memory location which is deleted. There are three different ways where a pointer can act as a dangling pointer. De-allocation of memory When the local variable is not static When the variable goes out of scope
Q6

Difference between malloc() and calloc() functions?

Verified Answer
malloc and calloc are library functions that allocate memory dynamically, which means that memory is allocated during the runtime from the heap segment. Malloc and Calloc differ in the number of arguments used, their initialization methods and also in the return values.
Q7

What is the difference between a structure and a Union?

Verified Answer
All the members of a structure can be accessed simultaneously but union can access only one member at a time Altering the value of a member will not affect the other members of the structure but where it affects the members of a union Lesser memory is needed for a union variable than a structure variable of the same type
Q8

What are static variables and functions?

Verified Answer
The variables and functions that are declared using the keyword Static are considered as Static Variable and Static Functions. The variables declared using Static keyword will have their scope restricted to the function in which they are declared.
Q9

Differentiate between Actual Parameters and Formal Parameters.

Verified Answer
The Parameters which are sent from main function to the subdivided function are called as Actual Parameters and the parameters which are declared a the Subdivided function end are called as Formal Parameters.
Q10

Can a C program be compiled or executed in the absence of a main()?

Verified Answer
The program will be compiled but will not be executed. To execute any C program, main() is required.

Community Discussion & Student Questions


Enosis Learning
Online