CPP 2 online test, online practice test, exam, quiz

CPP 2 Online Test

The purpose of this online test is to help you evaluate your CPP 2 knowledge yourself. These Multiple Choice Questions (MCQs) on CPP 2 will prepare you for technical round of job interview, written test and many certification exams.

The test contains 24 questions and there is no time limit. You will get 1 point for each correct answer. You will get your online test score after finishing the complete test.
(Total 24 questions)        (Time spent 0:0)

1. What is the output of the following code snippet?

class test {
public:
static int n;
test () { n++; };
~test () { n--; };
};

int test::n=0;
int main () {
test a;
test b[5];
test * c = new test;
cout << a.n << endl;
delete c;
cout << test::n << endl;
return 0;
}

   View Test Answer
Advertisement