How to find out if a number is odd or even

n = input("ENTER A POSITIVE NUMBER "); if (modulo(n,2)==0) then disp("ENTER NUMBER IS EVEN"); else disp("ENTER NUMBER IS ODD"); end

Answers (1)

Products

Tags

Asked:

on 25 Mar 2022

Answered:

on 25 Mar 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!