Menu

[solved] – Question 99179

Loops and flow control. Make function called loopTest(N) that loops through the values 1
through N and for each number n it should display ‘n is divisible by 2’, ‘n is divisible by 3’, ‘n is
divisible by 2 AND 3’ or ‘n is NOT divisible by 2 or 3’. Use a for loop, the function mod or rem to
figure out if a number is divisible by 2 or 3, and num2str to convert each number to a string for
displaying. You can use any combination of if, else, and elseif.

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *