My sibling ask me to find error in his coding. He want to find smallest value he get highest instead. i already try figure out. i spend 2 hour try changing his coding but still could fix it. this is his coding :
Well, each time you loop ... you read in new values of a, b, c ... and assign new values of lowest1 and lowest2 to b and c ... then you check 19 times whether something that can never happen does, nevertheless, happen.
So, if that filestream is positioned at the beginning of the file then you are probably going to write out the last items read successfully.
@Hyung. You need to have #include <limits> at the top of the code (where the other #include statements are). Your code posted above isn't a complete program - and I just changed the function.
In the code above, it returns the maximum possible value for the type int. As we've looking for the smallest value, first set the result to the largest Similarly, if looking for the largest value, first set the result to the smallest.
to use the int i for rows
Why - unless you want to know the row(s) for the largest values?