for (int i = 0; i <>
intList[i] = i * (i + 1);
for (auto p : intList)
cout <><>
What is the output of the following C++ code? (4)
int num = 1;
for (auto &p : intList)
{
if (num % 2 == num % 3)
p = 2 * num;
else
p = 3 * num;
num = p - 2;
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here