Fibonacci series using PL/SQL

Fibonacci series using PL/SQL, www.askhareesh.com

DECLARE
   NUM    NUMBER := #
   NUM1   NUMBER := 0;
   NUM2   NUMBER := 1;
   NUM3   NUMBER;
BEGIN
   DBMS_OUTPUT.PUT_LINE (NUM1);
   DBMS_OUTPUT.PUT_LINE (NUM2);

   FOR I IN 3 .. NUM
   LOOP
      NUM3 := NUM1 + NUM2;
      DBMS_OUTPUT.PUT_LINE (NUM3);
      NUM1 := NUM2;
      NUM2 := NUM3;
   END LOOP;
END;



*/

No comments:

Post a Comment