# Thread: Determine sum of every other value in list.

1. ## Determine sum of every other value in list.

Honestly I don't know anything about lists or pointers so I'm beyond lost on this.

"Write a function that takes a pointer to the front node of a linked list and determines the sum of every other value in the list starting with the first. (Note: If there are no items in the list, return 0.)

Code:
`int addEveryOther(struct ll* list)`
"

2. So you got an assignment to do something that your instructor never taught anything about?

3. Basically. It's a review problem for our final.

4. In pseudo-code :

Code:
```create variable sum, set it to 0
create variable count, set it to 0

while list pointer is not NULL
if (count is even) add list pointer's data to sum
if (next element in list is not NULL)
move list pointer to next element
increment count

return sum```
Looks like an opportunity for an obfuscated code contest to me. Anyone able to code this in one line?

5. Steps
1. Write a program to get the sum of every item in the linked list
2. Change it to skip every other item

Tim S.