1) Which programming structure is best suited to For loop b. While loop a. c. If..else d. Do while loop make decisions? 2) Which of the following loop bodies DOES compute a. the sum from 1 to 10...


1)<br>Which programming structure is best suited to<br>For loop<br>b. While loop<br>a.<br>c. If..else<br>d. Do while loop<br>make decisions?<br>2) Which of the following loop bodies DOES compute<br>a.<br>the sum from 1 to 10 (i.e., 1 + 2 + 3 + 4 + 5 + 6 + 7 +<br>b.<br>c. s+= i;<br>d. s+= i * i;<br>8 + 9 + 10)?<br>int s = 0;<br>s *= i;<br>s=s+s+i;<br>for (int i = 1; i <= 10; i++) {<br>//loop body here<br>3) Which loop is best to use when the number of<br>a. While loop<br>iterations is known beforehand?<br>b. If..else<br>Do while loop<br>d. For loop<br>с.<br>

Extracted text: 1) Which programming structure is best suited to For loop b. While loop a. c. If..else d. Do while loop make decisions? 2) Which of the following loop bodies DOES compute a. the sum from 1 to 10 (i.e., 1 + 2 + 3 + 4 + 5 + 6 + 7 + b. c. s+= i; d. s+= i * i; 8 + 9 + 10)? int s = 0; s *= i; s=s+s+i; for (int i = 1; i <= 10;="" i++)="" {="" loop="" body="" here="" 3)="" which="" loop="" is="" best="" to="" use="" when="" the="" number="" of="" a.="" while="" loop="" iterations="" is="" known="" beforehand?="" b.="" if..else="" do="" while="" loop="" d.="" for="" loop="">

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here