# Wu's Castle Post-SurveyExit this survey >>

*
*
2. Given the following code segment:
```for ( int j = 0; j <= 3; j++ )
{
cout << j << " ";
for ( int k = 0; k <=1; k++ )
{
cout << k << “ “;     // Line A
}
cout << endl;
} ```
Please write the output of this code:
*
3. How many times will Line A be executed?
 How many times will Line A be executed?   4839
*
4. Given the following code segment:
```int Num[10];
for ( int k = 0; k < kMax; k++ )
{
Num[k] = 1;
} ```
Which values of kMax will cause an out-of-bounds error?
 Given the following code segment: ```int Num[10]; for ( int k = 0; k < kMax; k++ ) { Num[k] = 1; } ``` Which values of kMax will cause an out-of-bounds error?   910111910000No values will produce an out-of-bounds errorThere is no such thing as an out-of-bounds error
*
5. Given this declaration:
```int Num[7]={0,0,1,2,3,4,5};
```
What are the values of the expressions below?
 Given this declaration: ```int Num[7]={0,0,1,2,3,4,5}; ``` What are the values of the expressions below?   Num[5] Num[0] Num[4] Num[2]+Num[3]
*
6. Given the following code segment:
```int x=7;
int Num[3][2];
for ( int j = 0; j <= 2 ; j++ )
{
for ( int k = 0; k <= 1 ; k++ )
{
Num[j][k] = x;
x++;
}
} ```
Which of the following shows the values in the last row of Num?
 Given the following code segment: ```int x=7; int Num[3][2]; for ( int j = 0; j <= 2 ; j++ ) { for ( int k = 0; k <= 1 ; k++ ) { Num[j][k] = x; x++; } } ``` Which of the following shows the values in the last row of Num?   7 810 11 129 1012 1211 127 7
*
7. Given the following code segment:
```int Num[100];
for ( int k = 0; k < 100; k++ )
{
Num[k] = 1;    // Line A
if ( k > 10 )
break;
} ```
How many times will Line A be executed?
 Given the following code segment: ```int Num[100]; for ( int k = 0; k < 100; k++ ) { Num[k] = 1; // Line A if ( k > 10 ) break; } ``` How many times will Line A be executed?   9911This program will crash10010
*
8. Given the array below:
```	9 8 7 6 5
4 3 2 1 0
1 2 3 4 5
6 7 8 9 0
5 5 5 5 5
```
What are the values for each of the expressions below?
 Given the array below: ``` 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 0 5 5 5 5 5 ``` What are the values for each of the expressions below?   Array[3][2] Array[5][4] Array[1][3] Array[2][1]+Array[0][1]