The semi-colon at the end from the while
statement is evaluated independently causing the body of the loop to execute unconditionally so the result is always the same
while (count > 0 && count <= termNum);
^
In addition the loop is terminating after the first iteration. Remove the first expression from the loop, i.e.
while (count <= termNum) {