I have been trying to display only the odd numbers between two user entered numbers by checking if both the numbers are positive. Here's my pl/sql block :
declare
num1 number(3);
num2 number(3);
begin
num1 := &num1;
num2 := &num2;
if (num1 > 0 and num2 > 0) then
dbms_output.put_line('Both entered numbers are positive');
dbms_output.put_line('The odd numbers between the two entered positive numbers are : ');
for i in num1..num2 loop
if mod(i,2)=0 then
dbms_output.put_line();
elsif
dbms_output.put_line(i);
end if;
i := i+1;
end loop;
elsif
dbms_output.put_line('Both entered numbers are not positive');
end if;
end;
/
But i keep getting error : PLS-00103: Encountered the symbol ";" when expecting one of the following:
at line 15;
even though after multiple checks I cannot find where the problem is.
Any help will be great.