What will be the output of the following C++ code? [code] #include <iostream> using namespace std; void square (int *x)

Hằng Đoàn

New member
What will be the output of the following C++ code?
Code:
    #include <iostream>
    using namespace std;
    void square (int *x)
    {
	*x = (*x + 1) * (*x);
    }
    int main ( )
    {
	int num = 10;
        square(&num);
	cout << num;
	return 0;
    }
A. 100
B. compile time error
C. 144
D. 110
 

Tìm kiếm

Back
Top