Conditions

DECLARE
    v_num NUMBER := &enter_a_number;
BEGIN
    IF mod(v_num,2) = 0 THEN
        dbms_output.put_line(v_num || ' is even');
    ELSIF mod(v_num,2) = 1 THEN
        dbms_output.put_line(v_num || ' is odd');
    ELSE
        dbms_output.put_line('None');
    END IF;
END;
Comments