Live quiz

cpp - Part 42

Question 1 of 25 Hints left: 3
Q1

What will be the output of the following C++ code? #include <iostream> using namespace std; class number { int i; public: int geti(); void puti(int j); }; int number::geti() { return i; } void number::puti(int j) { i = j; } int main() { number s; s.puti(10); cout << s.geti( ); return 0; }

  • A
  • B
  • C
  • D