C Interview Questions | Eklavya Online

C Interview Questions

What is the structure?

The structure is a user-defined data type that allows storing multiple types of data in a single unit. It occupies the sum of the memory of all members. The structure members can be accessed only through structure variables. Structure variables accessing the same structure but the memory allocated for each variable will be different.

What is C language?

C is a mid-level and procedural programming language. The Procedural programming language is also known as the structured programming language is a technique in which large programs are broken down into smaller modules, and each module uses structured code. This technique minimizes error and misinterpretation. More details.

Write a program to print Fibonacci series using recursion?

#include #include void printFibonacci(int n) // function to calculate the fibonacci series of a given number. { static int n1=0,n2=1,n3; // declaration of static variables. if(n>0){ n3 = n1 + n2; n1 = n2; n2 = n3; printf(“%d “,n3); printFibonacci(n-1); //calling the function recursively. } } void main(){ int n; clrscr(); printf(“Enter the number of …

Write a program to print Fibonacci series using recursion? Read More »

What functions are used for dynamic memory allocation in C language?

malloc() The malloc() function is used to allocate the memory during the execution of the program. It does not initialize the memory but carries the garbage value. It returns a null pointer if it could not be able to allocate the requested space. Syntax ptr = (cast-type*) malloc(byte-size) // allocating the memory using malloc() function. …

What functions are used for dynamic memory allocation in C language? Read More »

What is a union?

The union is a user-defined data type that allows storing multiple types of data in a single unit. However, it doesn’t occupy the sum of the memory of all members. It holds the memory of the largest member only. In union, we can access only one variable at a time as it allocates one common …

What is a union? Read More »

Why is C called a mid-level programming language?

C is called a mid-level programming language because it binds the low level and high -level programming language. We can use C language as a System programming to develop the operating system as well as an Application programming to generate menu driven customer driven billing system