//Odd Even function [a]=OddEven(Numbers) // if Numbers is even Nunmbers/2 has // an interger and a fractional components. // int() function removes the fractional // component I=int(Numbers/2) test=I-Numbers/2 // The test is to figure out if // there is a fractional components if test==0 then a="Even" else a="Odd" end endfunction Numbers=[1,2,3,4,5,11,17,8,20] s=size(Numbers) for i=1:s(1,2) a=OddEven(Numbers(1,i)); printf("%d is %s\n", Numbers(1,i),a) end // sample program by Celso B. Co