Question Detail
Question
Given the following segment of code: x=0 For i = 1 To 5 x=x+i Next i What will be the final value of x?
Correct Answer
Option C is the correct answer.
Detailed Explanation
The loop adds the value of i to x each iteration. So x = 0 + 1 + 2 + 3 + 4 + 5 = 15.
Hint
It's the sum of numbers from 1 to 5.