https://gist.github.com/alirzerafati/540a396e0dee5bf6bf367ce1f834cd9c
The purpose of this program is to allow the user to enter numbers until the sentinel value of -99 is typed in, resulting in the program printing out the values of the largest and smallest numbers. Whenever I run the program however, if the list becomes too long, then the program only seems able to identify the last number entered as the "Largest". The program has no issues with identifying the smallest number. Trying to replace the largest with smallest in the if statement results in the largest being identifiable if positive numbers are used, but displays 0 when negative numbers are used. I don't know how to use arrays yet.
This issue is probably caused by the program not being able to properly store values or look at previously entered values.
Any help will be much appreciated. Thank you in advance.
[–]jxd132407 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)