Info
This question is closed. Reopen it to edit or answer.
why not it work between 1 and 10?
1 view (last 30 days)
Show older comments
clc
num = input('enter a number between 1 and 10:->');
if (num < 1 && num > 10)
disp('invalid number')
else
disp('valid number')
end
4 Comments
Answers (1)
Dennis
on 14 Aug 2018
I think it is unlikely, that one number is smaller than 1 and bigger than 10 at the same time.
num = input('enter a number between 1 and 10:->');
if num > 1 && num < 10
disp('valid number');
else
disp('invalid number')
end
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!