Mega Code Archive

 
Categories / Delphi / Functions
 

Odd - tests whether an integer has an odd value system unit

function Odd ( Number : Integer | Int64 ) : Boolean; Description The Odd function returns true if the given Number is odd (divisible by 2). Related commands Boolean Allows just True and False values Example code : Show all odd numbers in the range 1 to 9 var i : Integer; begin // Display all odd numbers in the range 1 to 9 for i := 1 to 9 do if Odd(i) then ShowMessageFmt('%d is odd',[i]); end; Show full unit code 1 is odd 3 is odd 5 is odd 7 is odd 9 is odd