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 20 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
:D TYSM


pratush dev

  • Member
  • Posts: 321
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

Prostaglandins were first isolated from human semen in Sweden in the 1930s. They were so named because the researcher thought that they came from the prostate gland. In fact, prostaglandins exist and are synthesized in almost every cell of the body.

Did you know?

Illness; diuretics; laxative abuse; hot weather; exercise; sweating; caffeine; alcoholic beverages; starvation diets; inadequate carbohydrate consumption; and diets high in protein, salt, or fiber can cause people to become dehydrated.

Did you know?

The human body's pharmacokinetics are quite varied. Our hair holds onto drugs longer than our urine, blood, or saliva. For example, alcohol can be detected in the hair for up to 90 days after it was consumed. The same is true for marijuana, cocaine, ecstasy, heroin, methamphetamine, and nicotine.

Did you know?

The Centers for Disease Control and Prevention has released reports detailing the deaths of infants (younger than 1 year of age) who died after being given cold and cough medications. This underscores the importance of educating parents that children younger than 2 years of age should never be given over-the-counter cold and cough medications without consulting their physicians.

Did you know?

A serious new warning has been established for pregnant women against taking ACE inhibitors during pregnancy. In the study, the risk of major birth defects in children whose mothers took ACE inhibitors during the first trimester was nearly three times higher than in children whose mothers didn't take ACE inhibitors. Physicians can prescribe alternative medications for pregnant women who have symptoms of high blood pressure.

For a complete list of videos, visit our video library