I am going to ask a user to give me positive numbers, and I will quit once the user enters a negative number. Then, I will display all the positive numbers that they had entered. The code reads find to me, but for some reason, the array is not putting in the first positive number that the user passes to it… Any ideas will be greatly appreciated. Thank you.
i=0;answer='Enter a positive number: ';x=input(answer);while x>0 x=input(answer); i=i+1; A(i)=x;end
Best Answer