Consider the following declaration: int list[10]; int j;,br>Which of the following correctly outputs all the elements of list? (i) for(j = 1; j < 10; j++) cout<cout<(ii) for(j = 0; j <= 9; j++) cout<cout<
Consider the following declaration: double sales[50]; int j; Which of the following correctly initializes the array sales to 0? (i) for(j = 0; j < 49; j++) sales[j] = 0; (ii) for(j = 1; j <= 50; j++) sales[j] = 0;
Consider the following declaration: int list[10]; int j; int sum; Which of the following correctly finds the sum of the elements of list? (i) sum = 0; for(j = 0; j < 10; j++) sum = sum + list[j]; (ii) sum = list[0]; for(j = 1; j < 10; j++) sum = sum + list[j];
Which of the following statements declares alpha to be an array of 5 components of the type int and initializes each component to 0? (i) int alpha[5] = {0, 0, 0, 0, 0}; (ii) int alpha[5] = {0};
Consider the following declaration: int alpha[5] = {3, 5, 7, 9, 11}; Which of the following statements is equivalent to this statement? (i) int alpha[] = {3, 5, 7, 9, 11}; (ii) int alpha[5] = {3 5 7 9 11};
Consider the following declaration: int alpha[3]; Which of the following input statements correctly inputs values into alpha? (i) cin>>alpha >>alpha >>alpha; (ii) cin>>alpha[0] >>alpha[1] >>alpha[2];