Question: 1. Use the selectionSort method presented in this section to answer this question. What is list1 after executing the following statements? double list1[] = {3.1,
1. Use the selectionSort method presented in this section to answer this question. What is list1 after executing the following statements? double list1[] = {3.1, 3.1, 2.5, 6.4}; selectionSort(list1, 4);
| list1 is 3.1, 3.1, 2.5, 6.4 |
| list1 is 6.4, 3.1, 3.1, 2.5 |
| list1 is 2.5 3.1, 3.1, 6.4 |
| list1 is 3.1, 2.5, 3.1, 6.4 |
2. Which of the following statements are true?
| Every element in an array has the same type. |
| The array size is fixed after it is created. |
| The array elements are initialized when an array is created. |
| The array size used to declare an array must be a constant expression. |
3. What is wrong in the following code? char city[7] = "Dallas"; char s1[7]; strcpy(s1, city); cout << s1;
| If you change char s1[7] to char s1[17], it will work correctly. |
| If you change char city[7] to char city[], it will work correctly. |
| If you change char s1[7] to char s1[], it will work correctly. |
| There is no memory allocated to s1. Thus, you cannot copy anything into it.
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
