i am in beg c++ and my instructor is asking me to find "some other combination that also does not work! Your loop should prove something similar for values other than 10 cycles, steps of 0.1, and a sum of 1."
i found 1 combination, which is in my program below. I dont truly understand what round off errors are and feel as though i cant create another loop that doesnt work. does anyone have any ideas? any suggestion would be truly helpful.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double x;
for (x = 0; x != 1; x += 0.1)
cout << x << endl;
cin.ignore();
cin.get();
return 0;
}