Vân Anh Nguyen
Member
What is the output of the following program?
A. 20 22
B. 20 21
C. 21 22
D. 22 23
Code:
class Test
{
private: static int x;
public: static void fun()
{
cout << ++x << “ ”;
}
};
int Test :: x =20;
void main()
{
Test x;
x.fun();
x.fun();
}
B. 20 21
C. 21 22
D. 22 23