Write a function to ask for given number and report whether they are between 10 and 100 or not
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
please try
2 Commenti
Rik
il 18 Nov 2020
Modificato: Rena Berman
il 7 Mag 2021
Why did you flag your own question and the answer?
Risposte (1)
CP
il 7 Mar 2019
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 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!