I created this while loop but when I input a fraction that should terminate the loop it doesn't exit the loop.
Ratio=1;while (Ratio~=0 || Ratio~=(1/2) || Ratio~=1/3 || ... Ratio~=1/5 || Ratio~=1/11 || Ratio~=5/7) Ratio=(input('Enter a ratio (parts of milk)/(parts of coffee): ')); if (Ratio~=0 || Ratio~=1/2 || Ratio~=1/3 || ... Ratio~=1/5 || Ratio~=1/11 || Ratio~=5/7) disp('Invalid input'); endend
Best Answer