Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Monday 12 March 2018

PL/SQL fibonacci series

PL/SQL program to generate Fibonacci series




DECLARE  
a number;
b number;
c number;
num number;
BEGIN
  num:=&enter;           -- To take input from the user
  a :=0;
  b :=1;
  c :=0;
   for i in 1..num
     LOOP
      dbms_output.put_line(c);
       c :=a+b;
       a :=b;
       b :=c;
    END LOOP;
END;

No comments:

Post a Comment