Program Source Code
#include"stdio.h"
#include"conio.h"
void main()
{
int a , b , c , i=1;
clrscr();
a=0;
b=1;
printf(“Fibonacci Series”);
printf(“%d\n”, a);
printf(“%d\n”, b);
while(i<=10)
{
c=a+b;
printf(“%d”, c);
a=b;
b=c;
i++;
}
getch();
}
//Find Fibonacci Series Using Recursion in C Programming #include"stdio.h" #include"conio.h" fibonacci(int n); void main() { int n,r,i; clrscr(); printf("********** Fibonacci Series Using Recursion *********\n"); printf("enter a number: "); scanf("%d",&n); printf("\n\n"); for(i=0;i<=n;i++) { r=fibonacci(i); printf("\t%d",r); } getch(); } fibonacci(int n) { int f; if((n==1)||(n==2)) return(1); else if(n==0) return(0); else f=fibonacci(n-2)+fibonacci(n-1); return(f); }Output
declare
f1 number(3);
f2 number(3);
f3 number(3);
num number(3);
begin
f1:=0;
f2:=1;
f3:=0;
num:=1;
while num<=10
loop
dbms_output.put_line(f3);
f1 :=f2;
f2:=f3;
f3:=f1+f2;
num:=num+1;
end loop;
end;
//C Program for generate Fibonacci series
#include "stdio.h"
#include "conio.h"
void main()
{
int a,b,c,i,n;
clrscr();
a=0;
b=1;
printf("\n enter n for how many times generate series");
scanf("%d",&n);
printf("\n FIBONACCI SERIES\n");
printf("\t%d\t%d",a,b);
for(i=0;i<n;i++)
{
c=a+b;
a=b;
b=c;
printf("\t%d",c);
}
getch();
}