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

Author Question: Analyze the following code.double sum = 0;for (double d = 0; d < 10; sum += sum + d) { d += 0.1;} (Read 134 times)

mp14

  • Hero Member
  • *****
  • Posts: 534
Analyze the following code.

double sum = 0;
for (double d = 0; d < 10; sum += sum + d) {
d += 0.1;
}

◦ The program has a syntax error because the control variable in the for loop cannot be of the double type.
◦ The program compiles but does not stop because d would always be less than 10.
◦ The program compiles and runs fine.
◦ The program has a syntax error because the adjustment statement is incorrect in the for loop.


Related Topics

Need homework help now?

Ask unlimited questions for free

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

lorealeza

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




mp14

  • Member
  • Posts: 534
Reply 2 on: May 6, 2020
:D TYSM


Jossy

  • Member
  • Posts: 336
Reply 3 on: Yesterday
Wow, this really help

 

Did you know?

On average, someone in the United States has a stroke about every 40 seconds. This is about 795,000 people per year.

Did you know?

There are approximately 3 million unintended pregnancies in the United States each year.

Did you know?

Between 1999 and 2012, American adults with high total cholesterol decreased from 18.3% to 12.9%

Did you know?

About 60% of newborn infants in the United States are jaundiced; that is, they look yellow. Kernicterus is a form of brain damage caused by excessive jaundice. When babies begin to be affected by excessive jaundice and begin to have brain damage, they become excessively lethargic.

Did you know?

Autoimmune diseases occur when the immune system destroys its own healthy tissues. When this occurs, white blood cells cannot distinguish between pathogens and normal cells.

For a complete list of videos, visit our video library