Solved

Which of the Following Is Equivalent to This Code Segment

Question 4

Multiple Choice

Which of the following is equivalent to this code segment
Segment: int total = 0;
For (int i = 0;i < = 20;i += 2)
{
Total += i;
}


A) int total = 0;
for (int i = 20; i < 0; i += 1)
{
total += i;
}
B) int total = 0;
for (int i = 0; i <= 20; total += i, i += 2) ;
C) int total = 0;
for (int i = 0, i <= 20, total += i; i += 2) ;
D) int total = 0;
for (int i = 2; i < 20; total += i, i += 2) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions