MCQOPTIONS
Saved Bookmarks
This section includes 4 Mcqs, each offering curated multiple-choice questions to sharpen your Arrays knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
In the following program where is the variable a getting defined and where it is getting declared? |
| A. | extern int a is declaration, int a = 20 is the definition |
| B. | int a = 20 is declaration, extern int a is the definition |
| C. | int a = 20 is definition, a is not defined |
| D. | a is declared, a is not defined |
| Answer» B. int a = 20 is declaration, extern int a is the definition | |
| 2. |
Identify which of the following are declarations 1 : extern int x; 2 : float square ( float x ) { ... } 3 : double pow(double, double); |
| A. | 1 |
| B. | 2 |
| C. | 1 and 3 |
| D. | 3 |
| Answer» D. 3 | |
| 3. |
Is the following statement a declaration or definition? extern int i; |
| A. | Declaration |
| B. | Definition |
| C. | Function |
| D. | Error |
| Answer» B. Definition | |
| 4. |
Is there any difference between following declarations? 1 : extern int fun(); 2 : int fun(); |
| A. | Both are identical |
| B. | No difference, except extern int fun(); is probably in another file |
| C. | int fun(); is overrided with extern int fun(); |
| D. | None of these |
| Answer» C. int fun(); is overrided with extern int fun(); | |