Question: 1. Sort the following list using the selection sort algorithm as discussed in this chapter. Show the list after each iteration of the outer for
1. Sort the following list using the selection sort algorithm as discussed in this chapter. Show the list
after each iteration of the outer for loop.
36, 55, 17, 35, 63, 85, 12, 48, 3, 66
2. Given the declaration:
char string15[16];
Mark the following statements as valid or invalid. If a statement is invalid, explain why.
a. strcpy(string15, "Hello there");
b. strlen(string15);
c. string15 = "Jacksonville";
d. cin >> string15;
e. cout << string15;
f. if
(string15 >= "Nice day")
cout << string15;
g. string15[6] = 't';
3. Given the declaration:
char name[8] = "Shelly";
Mark the following statements as Yes if they output Shelly. Otherwise, mark the
statement as No and explain why it does not output Shelly.
a. cout << name;
b. for(int j = 0; j < 6; j++)
cout << name[j];
c. int j = 0;
while(name[j] != '\0')
cout << name[j++];
d. int j = 0;
while(j < 8)
cout << name[j++];
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
