First 20 numbers that are divisible by both 2 and 3 are not printing. Instead, bunch of 0's show up.
I am trying to print first 20 numbers that are divisible by both 2 and 3. Below is my code:
SET SERVEROUTPUT ON;
DECLARE
n number := 0;
BEGIN
WHILE n <= 40
LOOP
IF MOD (n, 6) = 0 THEN
DBMS_OUTPUT.PUT_LINE(n);
END IF;
END LOOP;
END;
The output is giving me bunch of 0's. Any ideas as to what I can change to make it work?