MCQs
Total Questions : 37
| Page 1 of 4 pages
Answer: Option B. -> 4 4 7
Answer: Option D. -> It will result in a compile time error.
Answer: Option D. -> It will result in a compile time error.
Answer: Option E. -> It will result in a compile time error.
Answer: Option C. -> The program will print output 4 8.
Answer: Option A. -> we can not create the array of reference.
None.
Answer: Option A. -> Hello world
In this program we used the concept of constant casting to cast the variable and printing it.
Output:
$ g++ ref2.cpp
$ a.out
Hello world
Answer: Option B. -> 10
The value is declared and it is post incremented, so it's value is 10.
$ g++ ref1.cpp
$ a.out
10
Answer: Option B. -> Alternate name for the variable
Because we are pointing memory address using temp variable
Answer: Option A. -> In swap 105 In main 105
As we are calling by reference the values in the address also changed. So the main and swap
values also changed.
Output:
$ g++ ref.cpp
$ a.out
In swap 105 In main 105