This topic contains a solution. Click here to go to the answer

Author Question: Do the following two statements in (I) and (II) result in the same value in sum?(I):for (int i = 0; ... (Read 21 times)

saraeharris

  • Hero Member
  • *****
  • Posts: 546

Question 1

The following loop displays ________.

for (int i = 1; i <= 10; i++) {
System.out.print(i + " ");
i++;
}

◦ 1 3 5 7 9
◦ 1 2 3 4 5 6 7 8 9
◦ 1 2 3 4 5 6 7 8 9 10
◦ 2 4 6 8 10
◦ 1 2 3 4 5

Question 2

Do the following two statements in (I) and (II) result in the same value in sum?

(I):
for (int i = 0; i<10; ++i) {
sum += i;
}

(II):
for (int i = 0; i<10; i++) {
sum += i;
}

◦ Yes
◦ No


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by saraeharris on May 6, 2020

robbielu01

  • Sr. Member
  • ****
  • Posts: 336
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 45% of students answer this correctly




saraeharris

  • Member
  • Posts: 546
Reply 2 on: May 6, 2020
Excellent


coreycathey

  • Member
  • Posts: 333
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

The tallest man ever known was Robert Wadlow, an American, who reached the height of 8 feet 11 inches. He died at age 26 years from an infection caused by the immense weight of his body (491 pounds) and the stress on his leg bones and muscles.

Did you know?

Amoebae are the simplest type of protozoans, and are characterized by a feeding and dividing trophozoite stage that moves by temporary extensions called pseudopodia or false feet.

Did you know?

Women are two-thirds more likely than men to develop irritable bowel syndrome. This may be attributable to hormonal changes related to their menstrual cycles.

Did you know?

The toxic levels for lithium carbonate are close to the therapeutic levels. Signs of toxicity include fine hand tremor, polyuria, mild thirst, nausea, general discomfort, diarrhea, vomiting, drowsiness, muscular weakness, lack of coordination, ataxia, giddiness, tinnitus, and blurred vision.

Did you know?

Oxytocin is recommended only for pregnancies that have a medical reason for inducing labor (such as eclampsia) and is not recommended for elective procedures or for making the birthing process more convenient.

For a complete list of videos, visit our video library