C++ test

No Description

Created on 23rd February 2025

What is the output of the following code snippet: `std::cout << (5 + 2) * 3;`?

Which of the following is a valid way to declare a pointer in C++?

What will happen if you attempt to dereference a null pointer?

In C++, what does the 'new' keyword do?

Which of the following is a correct syntax for a class in C++?

What is a destructor in C++?

What is the purpose of the 'virtual' keyword in C++?

What does the 'const' keyword signify when used in a function parameter?

What is the output of the following code snippet: `std::vector<int> v = {1, 2, 3}; std::cout << v.size();`?

Which of the following is the correct way to include a standard library in C++?

What is the output of the following C++ code snippet: 'std::cout << (5 + 3) * 2;'?

Which of the following correctly defines a class in C++?

What is polymorphism in the context of C++ programming?

In C++, what does the 'const' keyword signify when used in a function parameter?

Which of the following statements about constructors in C++ is TRUE?

What is the purpose of the 'virtual' keyword in C++?

What is a reference variable in C++?

Which of the following is NOT a feature of object-oriented programming in C++?

How do you allocate memory dynamically for an integer variable in C++?

What will be the output of the following code: 'std::cout << (true + false);'?

What is the output of the following C++ code? #include <iostream> using namespace std; int main() { int x = 5; cout << ++x; return 0; }

Which of the following is a correct way to define a function in C++?

What is the purpose of the 'virtual' keyword in C++?

Which operator is used to access members of a class in C++?

Consider the following code snippet. What does the 'delete' keyword do in C++? int* ptr = new int; delete ptr;

Which of the following statements about constructors is true?

In C++, what is the main purpose of the 'this' pointer?

What is the result of attempting to access an uninitialized pointer in C++?

What is the purpose of the 'friend' keyword in C++?

Which data structure is used to implement a stack in C++?

Congratulations!

You have answered 0 out of 30 questions correctly.

Your score is 0.00%.