‼️C++ Interview Question‼️
The following program fragment __________.
#include <iostream>
using namespace std;
int main()
{
int x = 10;
int &p = x;
cout<< &p<< &x;
return 0;
}
A. prints 10 and the address of x
B. results in a runtime error
C. prints the address of x twice
D.prints the address of p twice
Check out the solution and other question here :
https://www.studytonight.com/cpp/tests/8
The following program fragment __________.
#include <iostream>
using namespace std;
int main()
{
int x = 10;
int &p = x;
cout<< &p<< &x;
return 0;
}
A. prints 10 and the address of x
B. results in a runtime error
C. prints the address of x twice
D.prints the address of p twice
Check out the solution and other question here :
https://www.studytonight.com/cpp/tests/8
Studytonight
C++ Programming MCQs Test 1 | Online C++ Programming Test - Studytonight
C++ Practice Tests have the best questions to make you understand the topic well. After each section you study, give the related Practice test.