Consider the following code segment.
int total = 0;
for (int k = 0; k <= 100; k += 2)
{
total += k;
}
Which of the following for loops could be used to replace the for loop in the original code segment so that the original and the revised code segments store the same value in total?
A. for (int k = 0; k < 100; k += 2)
{
total += k + 1;
}
B. for (int k = 1; k < 101; k += 2)
{
total += k - 1;
}
C. for (int k = 0; k <= 101; k += 2)
{
total += k + 1;
}
D. for (int k = 1; k <= 101; k += 2)
{
total += k + 1;
}