Monday, 19 December 2022

C Programming Language Few Imp Oral Question's .

 1) Who is father of C programming language, and when was developed .

Dennis Ritchie in 1972 at bell laboratories in AT &T.

2)  What are the Feature's of C programming language . 

1) Simple

2) Portable 

3) Mid-Level

4)Fast Speed.

5)Structured 

3) What is mean by local variable 

A variable which is declared inside function or block is known as a local variable.

4) What is mean by global variable.

A variable which is declared outside function or block is known as a global variable.

5) What is the use of  function in C.

  • C functions are used to avoid the rewriting the same code again and again in our program.


6) What is the difference between call by value and call by reference 

  a) call by valueWhen a copy of the value is passed to the function, then the original value is not modified.
b) call by reference:  When a copy of the value is passed to the function, then the original value is modified.

7) What is the recursion in c :

When a function calls itself, and this process is known as recursion.

8) What is array in c : 

An Array is a group of similar types of elements. It has a contiguous memory location

9) What is pointer in c: 

9) What is static memory allocation: 

In case of static memory allocation, memory is allocated at compile time.

The static memory is allocated using static keyword . 


10) What is the dynamic memory allocation: 

dynamic  memory is allocated at runtime and memory can be increased while executing the program.

The malloc() or calloc() function is required to allocate the memory at the runtime.

11) What is malloc function and Syntax: 

 Malloc() 
The malloc() function is used to allocate the memory during the execution of the program.

Syntax:           
ptr= (cast-type*)malloc(byte-size);

11) What is calloc ()function and syntax: 

calloc() 
The calloc() is same as malloc() function, but the difference only is that it initializes the memory with zero value.
syntax: 
ptr=(cast-type*)calloc(n,element-size);

12) What is realloc ()function and syntax: 

realloc ()

The realloc() function is used to reallocate the memory to the  new size.
syntax:
ptr = realloc(ptr,newsize);

13) What is free() function and syntax: 

The free() function releases the memory allocated by either calloc() or malloc() function.
Syntax: 
free(ptr);


14) What is structure 

  1. The structure is a user-defined data type 
  2. Structure is collection of different data types in a single unit. 
  3. to declared using struct keyword 

15) What is union 

The union is a user-defined data type 
Union is collection of multiple data types in a single unit . 
In union, we can access only one variable at a time . 


No comments:

Post a Comment

GitHub Most Imp Command For Every Developer Learn:

 Top Command for GitHub:  1) git clone 2) git init and git status   3) git add file name  or git add .  4) git commit -m message  5) git rem...