What is the output of the following program segment? (2)
double list[5];
for (int i = 0; i <>
list[i] = pow(i, 3) + i / 2.0;
cout <><>
list[0] = list[4] - list[2];
list[2] = list[3] + list[1];
What is the output of the following C++ code? (2)
int alpha[8];
{
alpha[i] = i * (i + 1);
if (i % 2 == 0)
alpha[4 + i] = alpha[i] + i;
else if (i % 3 == 0)
alpha[4 + i] = alpha[i] - i;
else if (i > 0)
alpha[4 + i] = alpha[i] - alpha[i - 1];
}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here