Node:Odd, Next:, Previous:object, Up:Reference



Odd

Synopsis


function Odd (i: Integer): Boolean;

Description

Odd checks the parity of its argument i. It returns True if the argument is odd, False if it is even.

Conforming to

Odd is defined in ISO 7185 Pascal and supported by all known Pascal variants.

Example


program OddDemo;
var
  Foo: Integer;
begin
  Write ('Please enter an odd number: ');
  ReadLn (Foo);
  if not Odd (Foo) then
    WriteLn ('Odd''s not even! Something''s odd out there ...')
  else
    WriteLn (Foo, ' is pretty odd.')
end.

See also