Info
此问题已关闭。 请重新打开它进行编辑或回答。
why not it work between 1 and 10?
1 次查看(过去 30 天)
显示 更早的评论
clc
num = input('enter a number between 1 and 10:->');
if (num < 1 && num > 10)
disp('invalid number')
else
disp('valid number')
end
4 个评论
回答(1 个)
Dennis
2018-8-14
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 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!