So I've implemented braces on the while loop, changed the return data type on increment() from void to int, and returned a value to main. However, it's still in a loop, and I can't seem to find a solution without scrapping the function.
Code:
#include <iostream>
using namespace std;
int increment(int);
int main()
{
int count = 1;
while(count < 10)
{
cout << " The number after " << count;
increment(count);
cout << " is " << count << endl;
}
return 0;
}
int increment (int nextNumber)
{
nextNumber++;
return nextNumber;
}