Q:

Write a program in PL/SQL to print 1st n numbers with a difference of 3 and starting from 1

0

Write a program in PL/SQL to print 1st n numbers with a difference of 3 and starting from 1.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

DECLARE
  n number:= &first_n_number;
  i number:=1;
  m number:=1;
BEGIN
 DBMS_OUTPUT.PUT_LINE ('The first '||n||' numbers are: ');
  DBMS_OUTPUT.PUT (i||'  ');
    for i in 1..n-1 loop
	   m:=m+3;
	   dbms_output.put(m||'  ');
    END LOOP;
    dbms_output.new_line;
 END;
/

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now