Question OOP-CLS-0007
EasyWhat is the output of this code?
#include <iostream>
using namespace std;
class Point {
public:
int x;
};
int main() {
Point p;
p.x = 5;
cout << p.x;
return 0;
}
- A.
5
- B.
0
- C.
Show answer and explanation
Answer: A
p.x is set to 5 and then printed.