Loop structuring problem

This is a discussion on Loop structuring problem within the C++ Programming forums, part of the General Programming Boards category; I am having a problem with my loop structure code:
Code:
#include <iostream>
using namespace std;
void main( )
{
...

I have a trip value of 0 set to the code so it will end the loop. What I am trying to figure out is how to dismiss the 0 from the calculation of the average in the loop so it will only calculate however many entries there are until you end the loop with a 0. Anyone got an idea?

However, it's not good to use "0" as a terminating condition though, because the temperature of '0 degree' is a valid. You want to think of different terminating condition.
BTW, Average is not calculated correctly. Both Sum and Counter are type int. The value of Average will be the truncated result of Sum/Counter.