MCQOPTIONS
Saved Bookmarks
This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which of the following is used during memory deallocation in C? |
| A. | remove(p); |
| B. | delete(p); |
| C. | free(p); |
| D. | terminate(p); |
| Answer» D. terminate(p); | |
| 2. |
Why do we write (int *) before malloc? |
| A. | It is for the syntax correctness |
| B. | It is for the type-casting |
| C. | It is to inform malloc function about the data-type expected |
| D. | None of the mentionedView Answer |
| Answer» C. It is to inform malloc function about the data-type expected | |
| 3. |
Memory allocation using malloc() is done in _________ |
| A. | Static area |
| B. | Stack area |
| C. | Heap area |
| D. | Both Stack & Heap area |
| Answer» D. Both Stack & Heap area | |
| 4. |
In function free(p), p is a _______ |
| A. | int |
| B. | pointer returned by malloc() |
| C. | pointer returned by calloc() |
| D. | pointer returned by malloc() & calloc() |
| Answer» E. | |
| 5. |
calloc() returns storage that is initialized to. |
| A. | Zero |
| B. | Null |
| C. | Nothing |
| D. | One |
| Answer» B. Null | |
| 6. |
void * malloc(size_t n) returns? |
| A. | Pointer to n bytes of uninitialized storage |
| B. | NULL if the request can be satisfied |
| C. | Nothing |
| D. | None of the mentioned |
| Answer» B. NULL if the request can be satisfied | |
| 7. |
The function ____ obtains a block of memory dynamically. |
| A. | calloc |
| B. | malloc |
| C. | both calloc & malloc |
| D. | free |
| Answer» D. free | |