Files
Basalt2/node_modules/shiki/samples/matlab.sample
Robert Jelic b0a4a6da9c Vitepress
2025-02-10 06:53:23 +01:00

23 lines
542 B
Plaintext

clear
number = input('Give an integer: ');
remainder2 = rem(number,2);
remainder3 = rem(number,3);
if remainder2==0 & remainder3==0
'Your number is divisible by both 2 and 3'
else
if remainder2==0
'Your number is divisble by 2 but not by 3'
else
if remainder3==0
'Your number is divisible by 3 but not by 2'
else
'Your number is not divisible by either 2 or 3'
end
end
end
% From https://www.math.colostate.edu/~yzhou/course/matlab_doc/matlab_programming_intro.html