Hi ,my question is how do i make this while loop to not count the input '0' as a number. It should only ask you for numbers bigger than '0' and '0' quits the loop, but when i check my .txt file it still shows '0' as an entered number but not as a way to quit the loop. How do i tell this program that '0' is not a choice?? That '0' also shows up in .txt file as the lowest entered number but the number cant be lower or equal to '0'.
The unconventional style of indentation makes the code pretty hard to read.
However, you have some duplicate code inside the while loop.
The closing brace } of the loop should follow immediately after the cin >> x; at line 23.
Then what to do with the rest of the unwanted code (lines 24 to 32)?
Delete almost all of it. The only non-duplicated line is line 24, fr<<x<<endl;
Remove that line, instead insert that piece of code at the start of the loop, just after the opening brace { at line 15.
Almost there. Now you just need to fix line 13 which should simply read fr << "all the numbers:\n";