C Interview Questions | Eklavya Online

C Interview Questions

What is an array in C?

An Array is a group of similar types of elements. It has a contiguous memory location. It makes the code optimized, easy to traverse and easy to sort. The size and type of arrays cannot be changed after its declaration. Arrays are of two types: One-dimensional array: One-dimensional array is an array that stores the …

What is an array in C? Read More »

What is the use of a static variable in C?

Following are the uses of a static variable: A variable which is declared as static is known as a static variable. The static variable retains its value between multiple function calls. Static variables are used because the scope of the static variable is available in the entire program. So, we can access a static variable …

What is the use of a static variable in C? Read More »

What is a pointer in C?

A pointer is a variable that refers to the address of a value. It makes the code optimized and makes the performance fast. Whenever a variable is declared inside a program, then the system allocates some memory to a variable. The memory contains some address number. The variables that hold this address number is known …

What is a pointer in C? Read More »

What is the acronym for ANSI?

The ANSI stands for ” American National Standard Institute.” It is an organization that maintains the broad range of disciplines including photographic film, computer languages, data encoding, mechanical parts, safety and more.

What is the usage of the pointer in C?

Accessing array elements: Pointers are used in traversing through an array of integers and strings. The string is an array of characters which is terminated by a null character ‘\0’. Dynamic memory allocation: Pointers are used in allocation and deallocation of memory during the execution of a program. Call by Reference: The pointers are used …

What is the usage of the pointer in C? Read More »

What is the difference between getch() and getche()?

The getch() function reads a single character from the keyboard. It doesn’t use any buffer, so entered data will not be displayed on the output screen. The getche() function reads a single character from the keyword, but data is displayed on the output screen. Press Alt+f5 to see the entered character.

What is recursion in C?

When a function calls itself, and this process is known as recursion. The function that calls itself is known as a recursive function. Recursive function comes in two phases: Winding phase Unwinding phase Winding phase: When the recursive function calls itself, and this phase ends when the condition is reached. Unwinding phase: Unwinding phase starts …

What is recursion in C? Read More »

What is a NULL pointer in C?

A pointer that doesn’t refer to any address of value but NULL is known as a NULL pointer. When we assign a ‘0’ value to a pointer of any type, then it becomes a Null pointer.