Hi, in this program I am to open a .txt file and find the integer that is closest to 200.The code is working;however, the results is either giving me the last or the first number in the sequence.The numbers in the .txt files is...
55 67 458 23 81 33 782 375 528 405 324 950 46 14 864 551 38 167 518 630
Any help to improve the following code would be greatly appreciated.
your error is that either it is < or > you assign the closest with the number, it does not make sense. Simply remove the else if and put the line 25 before the line 18;