C++ Programming Test

    Welcome to your C++ Programming Test

    1. Which of the following is correct option? #include 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; }
    2. Which of the following is correct option? #include 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; }
    3. Which of the following is correct option? #include 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; }
    4. Which of the following is correct option? #include 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; }
    5. Which keyword is used to access the variable in the namespace?
    6. Which is the correct statement anout operator overloading in C++?.
    7. Which of the following operators cannot be overloaded?
    8. While overloading binary operators using member function, it requires ___ argument?
    9. Which of the following operators should be preferred to overload as a global function rather than a member method?
    10. Which of the following operator functions cannot be global, i.e., must be a member function.
    11. Which of the following is correct option?
    12. Which of the following is correct option?
    13. Which of the following is correct option?
    14. Which of the following is the correct order involves in the process of operator overloading. i) Define the operator function to implement the required operations. ii) Create a class that defines the data type that is to be used in the overloading operation. iii) Declare the operator function op() in the public part of the class.
    15. Which of the following is correct option?