1) Given the following declarations: char someString[30] = \"Whats up?\"; int in
ID: 3532683 • Letter: 1
Question
1) Given the following declarations:
char someString[30] = "Whats up?";
int intArray[5] = {2, 4, 6, 8, 10};
Write an output statement that displays the question mark from someString followed by a newline.
2) Given the following declarations:
char someString[30] = "Whats up?";
int intArray[5] = {2, 4, 6, 8, 10};
Write a statement that changes the value of 6 in the array to a 12
3) Given the following declarations:
char someString[30] = "Whats up?";
int intArray[5] = {2, 4, 6, 8, 10};
Write an output statement that displays the memory location of the value 4 stored in intArray[] in base-16 integer format.
PLEASE ANSWER THE ABOVE QUESTIONS USING INFO GIVEN FOR EACH.
Explanation / Answer
1:
cout << someString[8] << endl;
2:
intArray[2] = 12;
3:
cout << &intArray[1] << endl;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.