-1

enter image description here

I want to calculate the sum of the given values but i recieve this error

delaram
  • 649
  • 4
  • 8
  • 15

1 Answers1

1

Change var to int

for (int value in values) {
  sum += value;
}

and change

values = ['1, 3, 5, 7, 9']

to

values = [1, 3, 5, 7, 9]