C-Language Interview Questions
1 .
What is Memory Leak in C?
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.
2 .
Please explain what do you understand by while(0) and while(1)?
while(0) means that the looping conditions will always be false, i.e., the code inside the while loop will not be executed. On the opposite, while(1) is an infinite loop. It runs continuously until coming across a break statement mentioned explicitly.
 
Note : Any non-zero integer inside the braces of the while loop will give an infinite loop. For example, while(-22) and while(24) will both yield an infinite loop.
3 .
What do you understand by rvalue and ivalue?
The expression on the left of the assignment operator (=) is called an ivalue. An rvalue is an expression on the right side of the assignment operator, and it is assigned to an ivalue.
 
For instance,
int a = 25; 
int a is the ivalue in the above-mentioned example while 25 is the rvalue. While an ivalue persists beyond a single expression, the rvalue doesn’t persist beyond the expression using it.
4 .
Please explain bit fields in C.
Bit fields are variables defined with a predefined width (size) inside a structure. The general syntax of a bit field is :
 
struct {
    type [member_name] : width ;
};
 
type : Integer type, such as int and signed int, determining how a bit field’s value is interpreted.
 
member-name : Name of the bit field.
 
width : Number of bits in the bit field. Must be less than or equal to the bit width of the specified integer type.
5 .
What is a far pointer in C?
A far pointer is a 32-bit pointer capable of accessing all the 16 segments, i.e., the whole residence memory of RAM. It can access information outside the computer memory in a given segment. To use the far pointer, it is required to :
 
Allocate the sector register to store data address in the segment, and Store another sector register within the most recent sector
6 .
Why is C language known as “The mother of programming languages”?
The C language is commonly called the “The mother of programming languages” as it is the language that forms the bases of programming. It is a time-honoured language and has been widely used to develop some of the most significant compilers and kernels. C language is as old as the hills, and most of the modern languages are nothing but an adaptation from the C languages.
7 .
What are some of the limitations of C language?
As everything has a finite potential, so the C language stands in no exception. The following are some of the drawbacks of C languages :
 
Concept of OOPs : C language prohibits the concept of OOPs as it is based on the procedural approach. (Inheritance, Polymorphism, Encapsulation, Abstraction, Data Hiding).

Run Time Checking : C language does not do the running checking which means that errors are not detected after every line of coding, but only once the complete coding is done making it inconvenient to correct the bugs

Concept of the Namespace : C language does not exhibit the property of Namespace, so there cannot be two variables with the same name in the C language program.

Lack of Exception Handling : The language doesn’t exhibit the important feature of exception handling. The feature of exception handling doesn’t allow the user to detect the errors and bugs while compiling the code.

Insufficient Level for Abstraction : C language doesn’t have a very wide data handling capacity, which poses a threat to the security of the language.
8 .
List the difference between the source and object code.
Source code : Source codes usually get a command from the programmer and these codes are responsible for instructing the computer regarding what to perform? With extension .C we can save this code in C programming.

Object code : With the extension. OBJ, we can save the object code in C programming. This is the major difference between the two codes.
9 .
Random file access in C programming plays a very important part. Why? list some of its merits.
We all know that in every computer we store a large amount of significant information and every time we take a lot of time in finding the key content from the large database but this random access file helps in solving this problem.
 
* It helps to find the key data quicker from a large database.
* It helps indirectly shifting to target address when there are a lot of addresses in the programming.
10 .
Explain fast speed and memory management as a unique feature of C language?
Fast speed : The operators and data types used in C programming are very effective and powerful that increases the speed of working. Hence it helps in fastening up the speed.

Memory management : It has a very unique feature of in build memory that can handle a large amount of data very effectively and efficiently. This helps in improving the overall performance of C programming.