a)
Code Block | ||
---|---|---|
| ||
function result = wholeNumber(tallA) result = (tallA == round(tallA)); end |
b)
Code Block | ||
---|---|---|
| ||
function result = evenNumber(tallA)
result = (wholeNumber(tallA/2));
% eller
result = (mod(tallA,2) == 0);
end
|
a)
Code Block | ||
---|---|---|
| ||
function result = wholeNumber(tallA) result = (tallA == round(tallA)); end |
b)
Code Block | ||
---|---|---|
| ||
function result = evenNumber(tallA)
result = (wholeNumber(tallA/2));
% eller
result = (mod(tallA,2) == 0);
end
|