Live quiz

cpp - Part 9

Question 1 of 25 Hints left: 3
Q1

What will be the output of the following C++ code? #include <iostream> using namespace std; class Point { int x, y; public: Point(int i = 0, int j =0) { x = i; y = j; } int getX() const { return x; } int getY() {return y;} }; int main() { const Point t; cout << t.getX() << " "; cout << t.gety(); return 0; }

  • A
  • B
  • C
  • D