SET 4 TECHNICAL INTERVIEW QUESTIONS ON C++
1. Consider the following code
void main()
{
int x =10;
int &p=x;
cout<< &p<<&x;
}
(a) prints 10 and the adress of x (b) results in run time error
(c) prints the address of x twice (d) prints the adress of p twice.
2. Which of the following is not an storage class in c++
(a) register (b) auto (c) mutable (d) dynamic
3. Consider the following program segment
static char x[3] = " 1234";
cout<<x;
These two segments with complete program will print
(a) prints 123 (b) prints 12345
(c) prints 1234 followed by some junk (d) will give a compilation error
4. Which of the following operators cannot be overloaded?
(a) >> (b) >: (c) . (d) no such operator exists
5. CLASS DOG : PUBLIC A, PUBLIC B
is an example of
(a) Multiple Inheritence (b) Repeated Inheritence
(c) Linear Inheritence (d) None of these
NEXT SET 5 |||| PREVIOUS SET 3
No comments:
Post a Comment