T Thành Đạt New member Sep 18, 2021 #1 What will be the output of the following C++ code? Code: #include <iostream> using namespace std; int main() { int a = 9; int & aref = a; a++; cout << "The value of a is " << aref; return 0; } A. 9 B. 10 C. error D. 11
What will be the output of the following C++ code? Code: #include <iostream> using namespace std; int main() { int a = 9; int & aref = a; a++; cout << "The value of a is " << aref; return 0; } A. 9 B. 10 C. error D. 11
T Thanh Thảo New member Sep 18, 2021 #2 Answer: b Explanation: The value is declared and it isincrementedrement, so it's value is 10. Code: $ g++ ref1.cpp $ a.out 10 Upvote 0 Downvote
Answer: b Explanation: The value is declared and it isincrementedrement, so it's value is 10. Code: $ g++ ref1.cpp $ a.out 10