MCQOPTIONS
Saved Bookmarks
This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your C programming (MCQ) questions knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What does the following declaration mean?int (*ptr)[10]; |
| A. | ptr is array of pointers to 10 integers |
| B. | ptr is a pointer to an array of 10 integers |
| C. | ptr is an array of 10 integers |
| D. | ptr is an pointer to array |
| Answer» C. ptr is an array of 10 integers | |
| 2. |
How will you free the allocated memory? |
| A. | remove(var-name); |
| B. | free(var-name); |
| C. | delete(var-name); |
| D. | dalloc(var-name); |
| Answer» C. delete(var-name); | |
| 3. |
In the following code, the P2 is Integer Pointer or Integer? typedef int *ptr;ptr p1, p2; |
| A. | Integer |
| B. | Integer pointer |
| C. | Error in declaration |
| D. | None of the above |
| Answer» C. Error in declaration | |
| 4. |
In the following code what is 'P'? typedef char *charp;const charp P; |
| A. | P is a constant |
| B. | P is a character constant |
| C. | P is character type |
| D. | None of the above |
| Answer» B. P is a character constant | |
| 5. |
What is x in the following program? #includeint main(){typedef char (*(*arrfptr[3])())[10];arrfptr x;return 0;} |
| A. | x is a pointer |
| B. | x is an array of three pointer |
| C. | x is an array of three function pointers |
| D. | Error in x declaration |
| Answer» D. Error in x declaration | |
| 6. |
How will you free the memory allocated by the following program? #include#include#define MAXROW 3#define MAXCOL 4int main(){int **p, i, j;p = (int **) malloc(MAXROW * sizeof(int*));return 0;} |
| A. | memfree(int p); |
| B. | dealloc(p); |
| C. | malloc(p, 0); |
| D. | free(p); |
| Answer» E. | |
| 7. |
What do the following declaration signify? char *arr[10]; |
| A. | arr is a array of 10 character pointers. |
| B. | arr is a array of function pointer. |
| C. | arr is a array of characters. |
| D. | arr is a pointer to array of characters. |
| Answer» B. arr is a array of function pointer. | |
| 8. |
What do the following declaration signify? int (*pf)(); |
| A. | pf is a pointer to function. |
| B. | pf is a function pointer. |
| C. | pf is a pointer to a function which return int |
| D. | pf is a function of pointer variable. |
| Answer» D. pf is a function of pointer variable. | |
| 9. |
What do the following declaration signify? char **argv; |
| A. | argv is a pointer to pointer. |
| B. | argv is a pointer to a char pointer. |
| C. | argv is a function pointer. |
| D. | argv is a member of function pointer. |
| Answer» C. argv is a function pointer. | |