Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C++ Programming
»
References
Which of the following statement is correct about the program given below? #include
int main() { int x = 10; int &y = x; x = 25; y = 50; cout<< x << " " << --y; return 0; }
The program will print the output 25 49.
It will result in a compile time error.
The program will print the output 50 50.
The program will print the output 49 49.
Correct Answer:
The program will print the output 49 49.
← Previous Question
Next Question→
More Questions from
References
Which of the following statement is correct about the program given below? #include
int main() { int m = 2, n = 6; int &x = m++; int &y = n++; m = x++; x = m++; n = y++; y = n++; cout<< m << " " << n; return 0; }
Which of the following statement is correct about the program given below? #include
class Tab { int x, y; public: Tab(int x, int y) { this->x = x; this->y = y; } void Display() { cout<< x << " " << y; } }; int main() { int x = 50; int &y = x ; Tab b(y, x); return 0; }
Which of the following statements is correct? A reference is not a constant pointer. A referenced is automatically de-referenced.
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments