Interview Question On C Language
👉Download: C language program code and notes for polytechnic and bca students.
1)What is c language ?
Ans: C is a general-purpose programming language that is extremely popular, simple, and flexible to use. It is a structured programming language that is machine-independent and extensively used to write various applications, Operating Systems like Windows, and many other complex program.
2)Why c is know as mother of all language ?
Ans: C language is known as mother of all languages because most of the compilers and kernels are written in C today. And most of the languages which are developed after C language has borrowed heavily from it like C++, Python, Rust, javascript, etc.
3)Who is the founder of c language ?
Ans: Dennis Ritchie is the founder of c language.
4)When was c language developed ?
Ans: C programming language developed in the early 1972s by American computer scientist Dennis M. Ritchie at Bell Laboratories (formerly AT&T Bell Laboratories).
5)Write features of c language ?
Ans: The main features of c language are as follow :
- Simple: C language is simple because it follows the structure path follow.
- Portability: C language is lavishly portable as programs that are written in C language can run and compile on any system with either none or small changes.
- Middle level language: C is a mid-level programming language as it combines the low- level language with the features of the high-level language.
- Fast and Efficient: C language is very fast as it uses a powerful set of data types and operators.
- Rich Standard Library: C supports various inbuilt functions and libraries that create development fast. These libraries are called Header files in C language.
- Case sensitive Language: In C, the uppercase and lowercase characters are different. That means "int" is not the same as "INT" in C language.
6)What is the use of printf() and scanf() functions in c?
Ans: printf() and scanf() functions are inbuilt library functions in C programming language which are available in C library by default. These functions are declared and related macros are defined in “stdio.h” which is a header file in C language.
- printf() function is used to print the (“character, string, float, integer, octal and hexadecimal values”) onto the output screen.
- scanf() function is used to read character, string, numeric data from keyboard
Ans: The use of static variable in c language are follow:
- 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 anywhere in the program.
- The static variable is initialized only once in the memory heap to reduce the memory usage.
Syntax: static data_type var_name = var_value;
8)What is recursion in c ?
Ans: 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
Ans: An array is defined as the collection of similar type of data items stored at contiguous memory locations. Arrays are the derived data type in C programming language which can store the primitive type of data such as int, char, double, float, etc.
Syntax: data_type array_name[size];
Array are 2 types:
- One-dimensional array
- Two-dimensional array
Ans: Pointers (pointer variables) are special variables that are used to store addresses of other values. It makes the code optimized and makes the performance fast.
Syntax: Data_type *a;
11)What is Null pointer in c ?
Ans: A null pointer is a pointer which points nothing. When we assign a '0' value to a pointer of any type, then it becomes a Null pointer.
12)What is static memory allocation in c ?
Ans: In case of static memory allocation, memory is allocated at compile time, and memory can't be increased while executing the program.
- The lifetime of a variable in static memory is the lifetime of a program.
- The static memory is allocated using static keyword.
- The static memory is implemented using stacks or heap.
- The pointer is required to access the variable present in the static memory.
- The static memory is faster than dynamic memory.
- In static memory, more memory space is required to store the variable.
👉Also read: 30 MCQs on C Programming (Chapterwise)
👉Also read: 10+ Graphics program using c language