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 31 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


strudel15

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

 

Did you know?

Fatal fungal infections may be able to resist newer antifungal drugs. Globally, fungal infections are often fatal due to the lack of access to multiple antifungals, which may be required to be utilized in combination. Single antifungals may not be enough to stop a fungal infection from causing the death of a patient.

Did you know?

The use of salicylates dates back 2,500 years to Hippocrates's recommendation of willow bark (from which a salicylate is derived) as an aid to the pains of childbirth. However, overdosage of salicylates can harm body fluids, electrolytes, the CNS, the GI tract, the ears, the lungs, the blood, the liver, and the kidneys and cause coma or death.

Did you know?

Fewer than 10% of babies are born on their exact due dates, 50% are born within 1 week of the due date, and 90% are born within 2 weeks of the date.

Did you know?

Approximately 25% of all reported medication errors result from some kind of name confusion.

Did you know?

Women are 50% to 75% more likely than men to experience an adverse drug reaction.

For a complete list of videos, visit our video library