- #1
geft
- 148
- 0
I have the following code which does not wait for input and skips right to the end. Is there something I miss?
Code:
no = 0;
total = 0;
while ans>=0
ans = input('Input a number (negative to quit): ');
no = no+1;
total = total + ans;
end;
printf('\n');
disp('The input average is ');
total/no