Q:

Write a function isdivby4 that will receive an integer input argument, and will return logical 1 for true if the input argument is divisible by 4, or logical false if it is not

0

 Write a function isdivby4 that will receive an integer input argument, and will return logical 1 for true if the input argument is divisible by 4, or logical false if it is not.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

isdivby4.m

function out = isdivby4(inarg)

% Returns 1 for true if the input argument is 

% divisible by 4 or 0 for false if not

% Format of call: isdivby4(input arg)

% Returns whether divisible by 4 or not

out = rem(inarg,4) == 0;

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now