A
Q. What is the output of the following C++ code?
Code:
#include <iostream>
using namespace std;
void carree(int *x)
{
*x = (*x + 1) * (*x);
}
int main()
{
int n = 10;
carree(&n);
cout << n;
return 0;
}
using namespace std;
void carree(int *x)
{
*x = (*x + 1) * (*x);
}
int main()
{
int n = 10;
carree(&n);
cout << n;
return 0;
}
- Correct Answer - Option(B)
- Views: 27
- Filed under category C++
- Hashtags:
Discusssion
Login to discuss.