MCQOPTIONS
Saved Bookmarks
This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
#include<iostream> using namespace std; namespace lfc { int x = 10; } namespace lfc { int x = 20; } int main () { int x = 30; lfc::x; lfc::x; cout << x; return 0; }10.Which keyword is used to access the variable in the namespace? |
| A. | using |
| B. | dynamic |
| C. | const |
| D. | static |
| E. | |
| Answer» B. dynamic | |
| 2. |
#include<iostream> using namespace std; namespace lfc1 { int x = 10; } namespace lfc2 { int x = 20; } int main () { int x = 30; lfc1::x; lfc2::x; cout << x; return 0; }9.Which of the following is correct option? |
| A. | 30 |
| B. | 20 |
| C. | 10 |
| D. | Compile Error |
| Answer» E. | |
| 3. |
#include<iostream> using namespace std; namespace lfc1 { double var =30.1234; } namespace lfc2 { double var = 13.5478; } int main () { double a; a = lfc1::var - lfc2::var; cout << a; return 0; }8.Which of the following is correct option? |
| A. | 30 |
| B. | 20 |
| C. | 10 |
| D. | Compile Error |
| Answer» B. 20 | |
| 4. |
#include<iostream>using namespace std;namespace lfc1{ int var = 30;}namespace lfc2{ double var = 13.5478;}int main (){ int a; a = lfc1::var + lfc2::var; cout << a; return 0; }7.Which of the following is correct option? |
| A. | 16.5756 |
| B. | 17 |
| C. | 15 |
| D. | 16.57 |
| Answer» B. 17 | |
| 5. |
Which of the following is correct option? |
| A. | 43.5478 |
| B. | 43 |
| C. | 44 |
| D. | 30 |
| Answer» C. 44 | |
| 6. |
The use of Namespace is to structure a program into logical units? |
| A. | TRUE |
| B. | FALSE |
| C. | May Be |
| D. | Can't Say |
| Answer» B. FALSE | |
| 7. |
Which operator is used to signify the namespace in c++? |
| A. | conditional operator |
| B. | ternary operator |
| C. | scope operator |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |