3. Array and Strings. Please show the output result. (9*4 points = 36 %) Please explain how you get your answer shortly.
Posted: Fri May 20, 2022 5:21 pm
3. Array and Strings. Please show the output result. (9*4 points = 36 %) Please explain how you get your answer shortly. If you just write the answer without explanation, you will only get 1 point maximum. int values[5] = { 0 }; for (int k = 0; k < 5; k++) values[k] = k * 2; cout << values[2] << endl; (b) cout << values[4] << endl; char words[] = "NCKUME"; (c) cout << sizeof(words[0]) << endl; (d) cout << sizeof(words) << endl; char name1[] = "C++"; char name2[5] = { 'C','+' }; (e) cout << namel << endl; cout << name2 << endl; char stars[2][50] = { "Woody", "Buzz Lightyear" }; cout << stars [1][1] << endl; (h) cout << stars[1] << endl; string myString = "ME"; (i) cout << myString.length() << endl;