What is the output of the following program? [code] class Test { private: static int x; public: static void fun() { cout <<

What is the output of the following program?
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();
}
A. 20 22
B. 20 21
C. 21 22
D. 22 23
 

Tìm kiếm

Back
Top