Consultor Eletrônico



Kbase 19183: How to determine if odd or even integer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   06/10/1999
SUMMARY: The following code sample will illustrate how to check an integer's value and determine whether it's even or odd using the modulo function.

STEP BY STEP DETAILS:
1. In the procedure editor type the following:

DEFINE VARIABLE i AS INTEGER.

REPEAT:
UPDATE i.
IF i MODULO 2 = 0 THEN
MESSAGE "even".
ELSE
MESSAGE "odd".
END.