Answer to Question #50432 in Visual Basic for Bender

Question #50432
What is the value of sum after the following code is executed? Why?

Dim sum As Integer = 5
For i As Integer = 1 To 5
sum += i
Next
1
Expert's answer
2015-01-16T06:55:08-0500
Answer
Initial condition:
sum=5
Loop for sum
for i=1:5
sum=sum+i
end
Answer sum=20

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS