C++ Quiz

by | Nov 19, 2022 | Assessment, Interview

Welcome to our C++ quiz! C++ is a powerful programming language that’s widely used for developing system software, embedded systems, and video games. Whether you’re just starting to learn C++ or you’re an experienced developer, this quiz will challenge your knowledge of the language and help you identify areas where you might need to improve. With a mix of multiple choice and coding questions, you’ll be tested on topics like syntax, data types, pointers, templates, and more. So, let’s get started and see how well you know C++!

4

C++ Quiz

Test your knowledge of the C++ programming language with our interactive C++ quiz! Challenge yourself with a variety of multiple choice and coding questions on topics ranging from syntax to pointers and templates.

1 / 30

What will be the output of the following code?
#include
using namespace std;

int main() {
int r = 90;
r += 2;
cout << r; return 0; }

2 / 30

Which of the following will print the output as "I want 23 apples."

3 / 30

What is function overloading in C++?

4 / 30

Which of the following code will print "I am genius"?

5 / 30

Which of these operators can be used as a reference variable and memory address as well?

6 / 30

What is the output of the following code?
#include
#include
using namespace std;

int main() {
string name = "Julia";
cout << name; cout<

7 / 30

Which of the following is always public and does not have any return value?

8 / 30

In the below code, what is a constructor?
#include
using namespace std;

class MyName {
public:
MyName() {
cout << "Nice game"; } }; int main() { MyName myObj; return 0; }

9 / 30

To use encapsulation, we must declare the variable as

10 / 30

What is the output of the code below?

#include
#include
using namespace std;

int main() {
cout << sqrt(81) << "n"; cout << round(8.6) << "n"; return 0; }

11 / 30

The Derived class is also known as

12 / 30

What is called when many classes are related to each other and have many forms?

13 / 30

What is the function of the ofstream library?

14 / 30

Which of these are exception keywords in C++?

15 / 30

What will be the output of the following code?
#include
#include
using namespace std;

int main() {
string student[4] = {"Julie", "Rasica", "James", "Maria"};
student[2] = "Mahima";
cout << student[2]; return 0; }

16 / 30

Which of the following code will return 0 as output?

17 / 30

What will be the output of the following code?
#include
using namespace std;

int main() {
for (int i = 3; i < 8; i++) { cout << i << "n"; } return 0; }

18 / 30

Which of these Keyword is used as the last statement in the switch and does not need a break?

19 / 30

"if" Keyword is case sensitive?

20 / 30

What is the output of the following code?
#include
using namespace std;

int main() {
int s = 22;
int t = 36;
cout << (s > t);
return 0;
}

21 / 30

What is the function of the floor(x) in C++?

22 / 30

Which of the following code will return 1 as output?

23 / 30

Which of the following is used as input and uses the extraction operator >> ?

24 / 30

Which is the correct naming of variable in C++?

25 / 30

What is the output of the following code?
#include
using namespace std;
int main() {
string myPlace = "Jaipur";
cout << "I live in " << myPlace << "."; return 0; }

26 / 30

Which of the following code will print output of 39?

27 / 30

What will be the output of the following code?
#include
using namespace std;
int main() {
cout << "Good Morning"; cout << "What's there for Breakfast?"; return 0; }

28 / 30

The using namespace std can be replaced with which keyword and operator?

29 / 30

Which is the header file in C++ language?

30 / 30

C++ was developed as an extension of C by

Author

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Advertisement

Advertisement

Advertisement

Advertisement