Олимпиадный тренинг

Задача . 37334


Задача

Темы:
Refer to the following code segment. You may assume that arr is an array of int values.
int sum = arr[0], i = 0;
while (i < arr.length)
{
    i++;
    sum += arr[i];
}
Which of the following will be the result of executing the segment?
(A) Sum of arr[0], arr[1], . . . , arr[arr.length-1] will be stored in sum.
(B) Sum of arr[1], arr[2], . . . , arr[arr.length-1] will be stored in sum.
(C) Sum of arr[0], arr[1], . . . , arr[arr.length] will be stored in sum.
(D) An infinite loop will occur.
(E) A run-time error will occur.

time 1000 ms
memory 32 Mb
Правила оформления программ и список ошибок при автоматической проверке задач

Статистика успешных решений по компиляторам
Комментарий учителя