ok, let's forget the function part.

so far, you have this:

Code:

while (cin >> value)
{
if (value <= 0)
break;
values [index] = value;
index++;
if (index == 100)
break;
}

If all goes well, and the user enters valid input, your value array will hold *index* number of integers. Now you want to find the maximum value in that array. You can do it in a loop like this:

Code:

int maxvalue = 0; // start with the smallest expected value
for (int i = 0; i < index; ++i) // <-- you only need to iterate through the valid entries
{
if (values[i] > maxvalue)
maxvalue = values[i];
}

So now, you have the maximum value stored in the int maxvalue. What's next?