MATLAB Answers

0

Write a function to ask for given number and report whether they are between 10 and 100 or not

Asked by Inkulu Chandrahas on 7 Mar 2019
Latest activity Answered by CP
on 7 Mar 2019
please try

  0 Comments

Sign in to comment.

Tags

Products

1 Answer

Answer by CP
on 7 Mar 2019
 Accepted Answer

This is extrememly simple.
function checkNumber()
tmp = input('Enter a Number: ');
inBetween10and100 = tmp >= 10 && tmp <= 100;
if(inBetween10and100 == true)
fprintf('The value %.2f is between 10 and 100\n',tmp);
else
fprintf('The value %.2f is NOT between 10 and 100\n',tmp);
end
end

  0 Comments

Sign in to comment.