Okay so what I need to do is write a program that would create a file called "odd.txt" that contains odd numbers 1-99, one number per line.
So I wrote this code that would take an input file containing the numbers 1-99, one per line like so:
1 2 3 4 5
1
2
3
4
etc.
and output the odd ones by finding the remainder of the number divided by two and then sorting those that had 1 for a remainder into the output file.
My problem is that my program is outputting infinite ones into the output file and I have no idea how to get it to check every number instead of just repeatedly checking the first number. Using the while loop I have in there is what got it to start outputting only ones. Previously it wasn't outputting at all.