You've a few too many lines. 2 to be precise.
You should also include
sum=0;I think for you to learn you need to take that all away and think through what each line is doing for you. You do know how to compile this don't you?
Login