

MCQOPTIONS
Saved Bookmarks
This section includes 55 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. |
Is the following declaration correct?; |
A. | Yes |
B. | No |
Answer» B. No | |
2. |
Are the following declarations same? |
A. | Yes |
B. | No |
Answer» C. | |
3. |
It is not necessary to typecast the address returned by . |
A. | True |
B. | False |
Answer» C. | |
4. |
Is the following declaration correct? |
A. | Yes |
B. | No |
Answer» C. | |
5. |
Does the data type of all elements in the will be same. |
A. | True |
B. | False |
Answer» C. | |
6. |
What will be the output of the program?_x000D_
#include
|
A. | 2, 8 |
B. | 4, 8 |
C. | 2, 4 |
D. | 4, 12 |
Answer» E. | |
7. |
What will be the output of the program?_x000D_
#include
|
A. | Nagpur, Chennai, Bangalore |
B. | agpur, hennai, angalore |
C. | agpur, Chennai, angalore |
D. | agpur, Bangalore, Bangalore |
Answer» E. | |
8. |
Declare the following statement?_x000D_ "An array of three pointers to chars". |
A. | char *ptr[3](); |
B. | char *ptr[3]; |
C. | char (*ptr[3])(); |
D. | char **ptr[3]; |
Answer» C. char (*ptr[3])(); | |
9. |
Declare the following statement?_x000D_ "A pointer to an array of three chars". |
A. | char *ptr[3](); |
B. | char (*ptr)*[3]; |
C. | char (*ptr[3])(); |
D. | char (*ptr)[3]; |
Answer» E. | |
10. |
What will be the output of the program?_x000D_
#include
|
A. | 4, 4, 4 |
B. | 2, 2, 2 |
C. | 2, 8, 4 |
D. | 2, 4, 8 |
Answer» B. 2, 2, 2 | |
11. |
What will be the output of the program?_x000D_
#include
|
A. | 4, 4, 4 |
B. | 2, 4, 4 |
C. | 4, 4, 2 |
D. | 2, 4, 8 |
Answer» B. 2, 4, 4 | |
12. |
What will be the output of the program?_x000D_
#include
|
A. | 4, 4, 8 |
B. | 2, 4, 4 |
C. | 4, 4, 2 |
D. | 2, 4, 8 |
Answer» C. 4, 4, 2 | |
13. |
What will be the output of the program?_x000D_
#include
|
A. | 4, 4, 8 |
B. | 4, 4, 4 |
C. | 2, 4, 4 |
D. | 2, 4, 8 |
Answer» D. 2, 4, 8 | |
14. |
What do the following declaration signify?_x000D_ int *f(); |
A. | f is a pointer variable of function type. |
B. | f is a function returning pointer to an int. |
C. | f is a function pointer. |
D. | f is a simple declaration of pointer variable. |
Answer» C. f is a function pointer. | |
15. |
Declare the following statement?''An array of three pointers to chars''. |
A. | char *ptr[3](); |
B. | char *ptr[3]; |
C. | char (*ptr[3])(); |
D. | char **ptr[3]; |
Answer» C. char (*ptr[3])(); | |
16. |
Declare the following statement?''A pointer to a function which receives nothing and returns nothing''. |
A. | void *(ptr)*int; |
B. | void *(*ptr)() |
C. | void *(*ptr)(*) |
D. | void (*ptr)() |
Answer» E. | |
17. |
Declare the following statement?''A pointer to a function which receives an int pointer and returns float pointer''. |
A. | float *(ptr)*int; |
B. | float *(*ptr)(int) |
C. | float *(*ptr)(int*) |
D. | float (*ptr)(int) |
Answer» D. float (*ptr)(int) | |
18. |
Declare the following statement?''A pointer to an array of three chars'' |
A. | char *ptr[3](); |
B. | char (*ptr)*[3]; |
C. | char (*ptr[3])(); |
D. | char (*ptr)[3]; |
Answer» E. | |
19. |
What will be the output of the program?
#include
|
A. | Nagpur, Chennai, Bangalore |
B. | agpur, hennai, angalore |
C. | agpur, Chennai, angalore |
D. | agpur, Bangalore, Bangalore |
Answer» E. | |
20. |
What will be the output of the program under DOS?
#include
|
A. | 4, 4, 4 |
B. | 4, 2, 2 |
C. | 2, 8, 4 |
D. | 2, 4, 8 |
Answer» C. 2, 8, 4 | |
21. |
What will be the output of the program in Turbo C?
#include
|
A. | 4, 4, 8 |
B. | 4, 4, 4 |
C. | 2, 4, 8 |
D. | 2, 4, 4 |
Answer» E. | |
22. |
What will be the output of the program in DOS (Compiler - Turbo C)?
#include
|
A. | 4 |
B. | 8 |
C. | 16 |
D. | 22 |
Answer» C. 16 | |
23. |
What will be the output of the program?
#include
|
A. | 4343445454, 4343445454 |
B. | 4545455434, 4545455434 |
C. | 4294967295, 4294967295 |
D. | Garbage values |
Answer» D. Garbage values | |
24. |
Point out the error in the following program.
#include
|
A. | Error: Lvalue required |
B. | Error: Rvalue required |
C. | Error: invalid *p declaration |
D. | No error |
Answer» E. | |
25. |
We can modify the pointers "source" as well as "target". |
A. | 1 |
B. | |
Answer» B. | |
26. |
Are the following declarations same? char far *far *scr; char far far** scr; |
A. | Yes |
B. | No |
Answer» C. | |
27. |
What will be the output of the program?
#include
|
A. | 4, 4, 8 |
B. | 2, 4, 4 |
C. | 4, 4, 2 |
D. | 2, 4, 8 |
Answer» C. 4, 4, 2 | |
28. |
What do the following declaration signify? int *f(); |
A. | f is a pointer variable of function type. |
B. | f is a function returning pointer to an int. |
C. | f is a function pointer. |
D. | f is a simple declaration of pointer variable. |
Answer» C. f is a function pointer. | |
29. |
What will be the output of the program?
#include
|
A. | 2, 8 |
B. | 4, 8 |
C. | 2, 4 |
D. | 4, 12 |
Answer» E. | |
30. |
It is not necessary to typecast the address returned by malloc(). |
A. | 1 |
B. | |
Answer» C. | |
31. |
What will be the output of the program?
#include
|
A. | 4, 4, 4 |
B. | 2, 2, 2 |
C. | 2, 8, 4 |
D. | 2, 4, 8 |
Answer» B. 2, 2, 2 | |
32. |
Is the following declaration correct?char far *far *ptr; |
A. | Yes |
B. | No |
Answer» B. No | |
33. |
What will be the output of the program?
#include
|
A. | 4, 4, 4 |
B. | 2, 4, 4 |
C. | 4, 4, 2 |
D. | 2, 4, 8 |
Answer» B. 2, 4, 4 | |
34. |
Function can return a floating point number. |
A. | 1 |
B. | |
Answer» B. | |
35. |
Point out the error in the following program.
#include
|
A. | Error: invalid parameter in function display() |
B. | Error: invalid function call f=show; |
C. | No error and prints "IndiaBIX" |
D. | No error and prints nothing. |
Answer» D. No error and prints nothing. | |
36. |
What will be the output of the program in DOS (Compiler - Turbo C)?
#include
|
A. | 1 |
B. | 2 |
C. | 4 |
D. | 8 |
Answer» C. 4 | |
37. |
What do the following declaration signify? char *scr; |
A. | scr is a pointer to pointer variable. |
B. | scr is a function pointer. |
C. | scr is a pointer to char. |
D. | scr is a member of function pointer. |
Answer» D. scr is a member of function pointer. | |
38. |
What do the following declaration signify? void *cmp(); |
A. | cmp is a pointer to an void type. |
B. | cmp is a void type pointer variable. |
C. | cmp is a function that return a void pointer. |
D. | cmp function returns nothing. |
Answer» D. cmp function returns nothing. | |
39. |
Is the following declaration correct?void(*f)(int, void(*)()); |
A. | Yes |
B. | No |
Answer» B. No | |
40. |
Declare the following statement? "A pointer to a function which receives nothing and returns nothing". |
A. | void *(ptr)*int; |
B. | void *(*ptr)() |
C. | void *(*ptr)(*) |
D. | void (*ptr)() |
Answer» E. | |
41. |
Is the following declaration correct?char (* ( *f())[])(); |
A. | Yes |
B. | No |
Answer» B. No | |
42. |
We can allocate a 2-Dimensional array dynamically. |
A. | 1 |
B. | |
Answer» B. | |
43. |
What do the following declaration signify? void (*cmp)(); |
A. | cmp is a pointer to an void function type. |
B. | cmp is a void type pointer function. |
C. | cmp is a function that return a void pointer. |
D. | cmp is a pointer to a function which returns void . |
Answer» E. | |
44. |
What will be the output of the program (in Turbo C under DOS)?
#include
|
A. | 4, 4, 8 |
B. | 2, 4, 4 |
C. | 4, 4, 2 |
D. | 2, 4, 8 |
Answer» D. 2, 4, 8 | |
45. |
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. | |
46. |
Declare the following statement? "A pointer to an array of three chars". |
A. | char *ptr[3](); |
B. | char (*ptr)*[3]; |
C. | char (*ptr[3])(); |
D. | char (*ptr)[3]; |
Answer» E. | |
47. |
Point out the error in the following program (in Turbo C under DOS).
#include
|
A. | Error: Lvalue required |
B. | Error: Rvalue required |
C. | Error: cannot initialize more than one union member. |
D. | No error |
Answer» D. No error | |
48. |
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. | |
49. |
Does the data type of all elements in the union will be same. |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» C. 1 | |
50. |
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. | |