What is the output of the following C++ code? int list[5] = {0,5,10,15,20};
Int j;
For (j = 1; j <= 5; j++)
Cout << list[j] << " ";
Cout << endl;
A) 0 5 10 15 20
B) 5 10 15 20 0
C) 5 10 15 20 20
D) Code results in index out-of-bounds
Correct Answer:
Verified
Q7: Assume you have the following declaration double
Q8: If an array index goes out of
Q11: All components of an array are of
Q13: Given the declaration int list[20]; the statement
Q15: Arrays can be passed as parameters to
Q16: What is the output of the
Q17: Suppose list is a one dimensional array
Q18: Suppose that sales is an array of
Q19: Suppose that list is an array of
Q20: The array index can be any integer
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