1. What is stored in alpha after the following code executes? int alpha[5] = {0}
ID: 3645590 • Letter: 1
Question
1. What is stored in alpha after the following code executes?int alpha[5] = {0};
int j;
for (j = 0; j < 5; j++)
{
alpha[j] = 2 * j;
if (j % 2 == 1) //see if j is an even number
alpha[j - 1] = alpha[j] + j;
}
alpha = {0, 2, 4, 6, 8}
alpha = {0, 2, 9, 6, 8}
alpha = {0, 3, 4, 7, 8}
alpha = {3, 2, 9, 6, 8}
2. Consider the following declaration.
int alpha[3];
Which of the following input statements correctly inputs values into all the array elements of alpha?
cin >> alpha >> alpha >> alpha;
cin >> alpha[0] >> alpha[1] >> alpha[2];
cin >> alpha[1] >> alpha[2] >> alpha[3];
cin >> alpha
3. (TCO 1)the following multidimensional array declaration, how many elements exist in the array?
double neoMatrix[4][5][6];
456
60
15
120
4. What id in alpha after the following code executes?
int alpha[5] = {0};
int j;
for (j = 0; j < 5; j++)
{
alpha[j] = j + 1;
if (j > 2)
alpha[j - 1] = alpha[j] + 2;
} (Points alpha = {1, 2, 6, 7, 5}
alpha = {1, 2, 3, 4, 5}
alpha = {4, 5, 6, 7, 9}
None of these
5. What is storlpha after the following code executes?
int alpha[5] = {0};
int j;
for (j = 0; j < 5; j++)
{
alpha[j] = j + 5;
if ( j % 2 == 1) //see if j is an even number
alpha[j - 1] = alpha[j] + 2;
}
alpha =, 9}
alpha = {5, 6, 10, 8, 9}
alpha = {8, 6, 7, 8, 9}
alpha = {8, 6, 10, 8, 9}
Explanation / Answer
1) alpha = {3, 2, 9, 6, 8} 2) cin >> alpha[1] >> alpha[2] >> alpha[3] 3) 15 4) alpha = {1, 2, 3, 4, 5} 5) alpha = {5, 6, 10, 8, 9}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.