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

Author Question: What is i after the following for loop?int y = 0;for (int i = 0; i<10; ++i) { y += i; } (Read 25 times)

shenderson6

  • Hero Member
  • *****
  • Posts: 573

Question 1

What is the output for y?

int y = 0;
for (int i = 0; i<10; ++i) {
y += i;
}
System.out.println(y);

◦ 12
◦ 13
◦ 45
◦ 11
◦ 10

Question 2

What is i after the following for loop?

int y = 0;
for (int i = 0; i<10; ++i) {
y += i;
}

◦ 10
◦ 11
◦ 9
◦ undefined


Related Topics

Need homework help now?

Ask unlimited questions for free

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

cupcake16

  • Sr. Member
  • ****
  • Posts: 309
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 39% of students answer this correctly




shenderson6

  • Member
  • Posts: 573
Reply 2 on: May 6, 2020
Thanks for the timely response, appreciate it


aliotak

  • Member
  • Posts: 326
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

The first oral chemotherapy drug for colon cancer was approved by FDA in 2001.

Did you know?

Intradermal injections are somewhat difficult to correctly administer because the skin layers are so thin that it is easy to accidentally punch through to the deeper subcutaneous layer.

Did you know?

According to research, pregnant women tend to eat more if carrying a baby boy. Male fetuses may secrete a chemical that stimulates their mothers to step up her energy intake.

Did you know?

More than 30% of American adults, and about 12% of children utilize health care approaches that were developed outside of conventional medicine.

Did you know?

Only 12 hours after an egg cell is fertilized by a sperm cell, the egg cell starts to divide. As it continues to divide, it moves along the fallopian tube toward the uterus at about 1 inch per day.

For a complete list of videos, visit our video library