hi all my code is producing a sum of 19 when it is meant to be producing a sum of 14? Can anyone see where my error is? need a fresh pair of eyes been staring at it for too long
#include <iostream>
using namespace std;
int main()
{
int next = 2, sum = 1;
while (next <= 5)
{
next++;
sum = sum + next;
}
cout << "The sum of 2 through 5 is " << sum << endl;
}