Join our Telegram Channel

Memory Allocation - Objective type Interview question with answers on C Programming

1 With every use of memory allocation function, what function should be used to release allocated memory which is no longer needed?
A dropmem()
B dealloc()
C release()
D free()

Answer: Option [D]

The library function free() is used to deallocate the memory that is no longer be used. This deallocated memory is dynamically allocated by malloc, calloc and realloc previously.

2 Physically placing the machine instructions and data into main memory is done by
A Linker
B Loader
C Code Generator
D Interpreter

Answer: Option [B]


3 Which header file should be included to use function like malloc() and calloc()?
A memory.h
B stdlib.h
C string.h
D dos.h

Answer: Option [B]

The stdlib.h header file contains malloc(), calloc() and realloc() dynamically allocated array functions.

4 How will you free the allocated memory?
A remove(variable-name);
B free(variable-name);
C delete(variable-name);
D dealloc(variable-name);

Answer: Option [B]
5 Which data structure is used by malloc() for object creation?
A Heap
B Tree
C Stack
D Queue

Answer: Option [A]

Take Mock Tests

Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Trigonometry - Mock Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
Englist(Antonyms) Mock Test 1 Start Test!
Quantitative Aptitude (Percentage) Mock Test Start Test!
Economy Mock Test 1 Unlock Test!
Economy Mock Test 2 Unlock Test!
Economy Mock Test 3 Unlock Test!
Economy Mock Test 4 Unlock Test!
Economy Mock Test 5 Unlock Test!
Books & Authors - Test 2 Unlock Test!