PL/SQL Program for even or odd number
Here you will get PL/SQL program for even or odd number checker.
If a number is completely divisible by 2 is called even else odd number.
PL/SQL Program for even or odd number
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | DECLARE num NUMBER; BEGIN -- Input a number DBMS_OUTPUT.PUT_LINE('Enter a number:'); num := # -- Check if number is even or odd IF MOD(num, 2) = 0 THEN DBMS_OUTPUT.PUT_LINE('The number ' || num || ' is Even.'); ELSE DBMS_OUTPUT.PUT_LINE('The number ' || num || ' is Odd.'); END IF; END; / |
Output
Enter a number: 8
The number 8 is Even.
Enter a number: 5
The number 5 is Odd.
Check out our other PL/SQL programs examples