Examveda

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void square (int *x, int *y)
{
	*x = (*x) * --(*y);
}
int main ( )
{
	int number = 30;
	square(&number, &number);
	cout << number;
	return 0;
}

A. 870

B. 30

C. Error

D. Segmentation fault

Answer: Option A


Join The Discussion

Related Questions on Functions and Procedures in C plus plus