[Solved]C 40 2 Output Following Code Char Symbol 3 B C Int Index 0 Index 3 Index Cout Symbol Index Q37077696
C++4.0 (2) What is the output of the following code?char symbol[3] = {‘a’,’b’,’c’};for (int index = 0; index < 3; index++)cout << symbol[index];
5.0 (2) What is the output of the following code?double a[3] = {1.1,2.2,3.3};cout << a[0] <<” “ << a[1] << “ “<< a[2] << endl;a[1] = a[2];cout << a[0] <<” “ << a[1] << “ “<< a[2] << endl;6.0 (2) What is the output of the following code?int i, temp[10];for (i = 0; i < 10; i++)temp[i] = 2*i;for (i = 0; i < 10; i++)cout << temp[i] << “ “;cout << endl;for (i = 0; i < 10; i=i+2)cout << temp[i] << “ “;7.0 (2) What is wrong with the following piece of code?int sample_array[10];for (int index = 1; index <= 10; index++)sample_array[index] = 3*index;8.0 (2) Suppose you have the following array declaration inyour program:int your_array[7];Also suppose that in your implementation of C++, variables oftype int use two bytes of memory. When you run your program, howmuch memory will this array consume? Suppose when you run yourprogram, the system assigns memory address 1000 to the indexedvariable your_array[0]. What will be the address of the indexedvariable your_array[3]?9.0 (3) Consider the following definition:int tripler(int n){return 3*n;}Which of the following are acceptable function calls?int a[3] = {4,5,6}, number = 2;tripler(number);tripler(a[2]);tripler (a[3]);tripler(a[number]);tripler(a);10.0 (5) Code a program to show with asterisks, the numbersrepresented in an array. Also print the number.int x [10] = { 5,1,9,5,8,8,3,2,10,8};11.0 (2) Suppose we expect the elements of an array to be inorder. However, to be safe, we want our program to test the arrayand issue a warning in case it turns out that that some elementsare out of order. The following code is supposed to do that butthere is an error. Can you find it and correct it?double a [10];–some code to fill the array—for (int index = 0; index < 10; index++)if (a[index] > a[index + 1])cout << “array elements “ << index <<” and“ << index + 1 << “ are out of order” <<endl;
Expert Answer
Answer to C++4.0 (2) What is the output of the following code?char symbol[3] = {‘a’,’b’,’c’};for (int index = 0; index… . . .
OR

