QUESTION 24
Consider the following declaration
int alpha[5] = {3, 5, 7, 9, 11};
Which of the following is equivalent to this statement?
1. int alpha[] = {3, 5, 7, 9, 11};
2. int alpha[] = {3 5 7 9 11};
3. int alpha[5] = [3, 5, 7, 9, 11];
4. int alpha[] = (3, 5, 7, 9, 11);
QUESTION 25
Which of the following correctly declares name to be a character array and stores "William" in it?
1. char name[6] = "William";
2. char name[7] = "William";
3. char name[8] = "William";
4. char name[8] = 'William';
QUESTION 26
Consider the following statement:
float alpha[10][5];
The number of elements of alpha is ____.
1. 15
2. 50
3. 100
4. 150
QUESTION 27
Consider the statement
int list[10][8];
Which of the following about list is true?
1. list has 10 rows and 8 columns.
2. list has 8 rows and 10 columns.
3. list has a total of 18 elements.
4. list has a total of 108 elements.
QUESTION 24
The correct answer is option 1: int alpha[] = {3, 5, 7, 9, 11}
QUESTION 25
The correct answer is option 2: char name[7] = “William”;
QUESTION 26
The correct answer is option 2: 50
QUESTION 27
The correct answer is option 1: List has 10 rows and 8 columns.
Comments
Leave a comment