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!