1. What is the output of the following code:
cout << 2/2+2/2-2+2 << endl;
2. Which of the following lines are correct C++ code. For the ones that are correct syntactically, what will be the output.
cout << "Hello" << "World" << endl;
(cout << "HelloWorld") << endl;
(cout << "HelloWorld").operator<<(endl);
3. Is anything wrong with the following code:
cMyType *p = new cMyType [10];
delete p;
4. What is the output of the following code:
for (unsigned int i = 0; i < 100; ++i)
if (i & 0x00000001) cout << i << endl;
5. What is the difference between class and struct?
6. State one difference between a reference and a pointer.