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 122 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
Thanks for the timely response, appreciate it


Dinolord

  • Member
  • Posts: 313
Reply 3 on: Yesterday
Gracias!

 

Did you know?

Only one in 10 cancer deaths is caused by the primary tumor. The vast majority of cancer mortality is caused by cells breaking away from the main tumor and metastasizing to other parts of the body, such as the brain, bones, or liver.

Did you know?

Aspirin may benefit 11 different cancers, including those of the colon, pancreas, lungs, prostate, breasts, and leukemia.

Did you know?

By definition, when a medication is administered intravenously, its bioavailability is 100%.

Did you know?

The newest statin drug, rosuvastatin, has been called a superstatin because it appears to reduce LDL cholesterol to a greater degree than the other approved statin drugs.

Did you know?

More than 20 million Americans cite use of marijuana within the past 30 days, according to the National Survey on Drug Use and Health (NSDUH). More than 8 million admit to using it almost every day.

For a complete list of videos, visit our video library