I have a loop problem im stuck on Which of the following loops would adequately
ID: 3618601 • Letter: I
Question
I have a loop problem im stuck onWhich of the following loops would adequately add 1 to eachelement stored in values?
a. for(j=1; j<values.length-1;j++) values[j]++; b. for(j=0; j<values.length1;j++) values[j]++; c. for(j=1; j<values.length1;j++) values[j]++; d. for(j=0; j<values.length-1;j++) values[j]++; e. for(j=0; j<=values.length1;j++) values[j]++;
Which of the following loops would adequately add 1 to eachelement stored in values?
a. for(j=1; j<values.length-1;j++) values[j]++; b. for(j=0; j<values.length1;j++) values[j]++; c. for(j=1; j<values.length1;j++) values[j]++; d. for(j=0; j<values.length-1;j++) values[j]++; e. for(j=0; j<=values.length1;j++) values[j]++;
Explanation / Answer
please rate - thanks I think a few of your choices are not what they are supposed tobe. I think there are a few extra 1 in there the answer is for(j=0; jRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.