Question
1. (TCO 1) What is the output of the following C++ code? int list[5] = {0, 5, 10, 15, 20}; int j; for (j =
0 1 2 3 4 0 5 10 15 0 5 10 15 20 5 10 15 20 |
alpha = {5, 6, 7, 8, 9} alpha = {5, 6, 10, 8, 9} alpha = {8, 6, 7, 8, 9} alpha = {8, 6, 10, 8, 9} |
2 4 6 8 10 4 3 2 1 0 8 6 4 2 0 10 8 6 4 2 |
Only (i) Only (ii) Both (i) and (ii) None of these |
15 50 100 150 |
int alpha[4][3] = {{0,1,2} {1,2,3} {2,3,4} {3,4,5}}; int alpha[4][3] = {0,1,2; 1,2,3; 2,3,4; 3,4,5}; int alpha[4][3] = {0,1,2: 1,2,3: 2,3,4: 3,4,5}; int alpha[4][3] = {{0,1,2}, {1,2,3}, {2,3,4}, {3,4,5}}; |
sum = 0; for(j = 0; j < 7; j++) sum = sum + sale[5][j]; sum = 0; for(j = 0; j < 7; j++) sum = sum + sale[4][j]; sum = 0; for(j = 0; j < 7; j++) sum = sum + sale[j][4]; sum = 0; for(j = 0; j < 7; j++) sum = sum + sale[j][5]; |
456 60 15 120 |
a data type. an object type. a variable. an enumeration. |
must be public and all member variables must be private. must be public and all member variables must be public also. and member variables can be either public or private. must be private and all member variables must be public. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started