I am writing a program where the user is asked to input values that should be stored in an array (a range of min 0 values and max 100 values). After user decides not to input any new values, the array should be sorted an the program should output the array in ascending order. Something is wrong with me code. After I input a value and hit enter after the first input, nothing more happens and I can't figure out what the error is. It doesn't ask if user wants to input another value and it doesn't output anything. Any help will be greatly appreciated! (I am very very new to this.)
In line 13, 'i' is an undeclared variable. You must first declare it and maybe give it an initial value before the loop block.
For the if block(line 18), it will be advisable to bring the curly brackets, since you want to execute more than a line based on a condition.
Thank you so much! Based on the global variables at the top, should 'i' be substituted by 'countTotalValues' throughout the code? Isn't that the variable I am really referring to every time 'i' is used in this code?
Then at the bottom in the 'if' construct used for sorting, should 'i' be substituted for '100' since this is the max value? Thanks again!