Examveda

What will be the output of the following C++ 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

A. 100

B. compile time error

C. 144

D. 110

Answer: Option D


Join The Discussion

Related Questions on Functions and Procedures in C plus plus