In my opinion, b is the better structure. In a, the last value of intermediateResult sticks around after your loop is finished.
Edit: This doesn't make a lot of difference with value types, but reference types can be somewhat weighty. Personally, I like variables to be dereferenced as soon as possible for cleanup, and b does that for you,