What is the output of the following code (assuming it is embedded in a correct and complete program) ?
char letter[5] = {'o','k','c','e','g'};
for(int i = 4;i >= 0;i-- )
cout << letter[i];
cout << endl;
choices:
A) okceg
B) gecko
C) ecko followed by a character from an out of bounds access.
D) kceg followed by a character from an out of bounds access.
E) Correct answer not listed.Specify what the output is.
Correct Answer:
Verified
Q22: Explain the error in the following code.You
Q23: Here is a list of 8 numbers.Use
Q24: Consider the declaration
double a[10] = {1.2,2.1,3.3,3.5,4.5,7.9,5.4,
8.7,9.9,1.0};
Write a
Q25: Given the definition and code fragment: int
Q26: Given the array declaration,int a[20];The first element
Q27: Suppose we want an array to satisfy
Q28: Insert const before .any of the following
Q30: Write the selection sort algorithm for an
Q31: What is the problem with this code?
int
Q32: Assume you have a swap routine in
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents