MCQOPTIONS
Saved Bookmarks
This section includes 5 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. |
typedef int (*PFI)(char *, char *)creates ___________. |
| A. | type PFI, for pointer |
| B. | type PFI, function (of two char * arguments) returning int |
| C. | type PFI, for pointer to function (of two char * arguments) returning int |
| D. | error |
| E. | None of these |
| Answer» D. error | |
| 2. |
Which of the following will be the correct output for the program given below ? |
| A. | 1 2 3 4 |
| B. | 1 2 3 4 5 |
| C. | No output |
| D. | Error: Cannot use typedef with an array |
| Answer» B. 1 2 3 4 5 | |
| 3. |
Which of the given option is the correct method for initialization? |
| A. | Not more than one space should be given when using typedef |
| B. | *string *q = Welcome ; |
| C. | string p = Welcome ; |
| D. | *string p = B ; |
| E. | None of these |
| Answer» D. *string p = B ; | |
| 4. |
Which option should be selected to work the following C expression? |
| A. | Such expression cannot be generated in C |
| B. | typedef char [] string; |
| C. | typedef char *string; |
| D. | typedef char [] string; and typedef char *string; |
| E. | None of these |
| Answer» D. typedef char [] string; and typedef char *string; | |
| 5. |
Which is the correct syntax to use typedef for struct? |
| A. | <pre class="prettyprint lang-c">struct temp<br> {<br> int n;<br> };<br> typedef struct temp TEMP;<br></pre> |
| B. | <pre class="prettyprint lang-c">typedef struct temp<br> {<br> int n;<br> }TEMP;<br></pre> |
| C. | <pre class="prettyprint lang-c">typedef struct temp<br> {<br> int n;<br> }TEMP;<br></pre> |
| D. | All of above |
| E. | None of these |
| Answer» E. None of these | |