Saturday, July 13, 2019

Fibonacci Series in C

Fibonacci series

fibonacci series

#include<stdio.h>
#include<conio.h>

void main()
{
int first=0,second=1,temp,n,i;
clrscr();
printf("Enter The Value");
scanf("%d",&n);

printf("%d\n%d",first,second);

for(i=1;i<=n;i++)
{
temp=first+second;
first=second;
second=temp;
printf("\n%d",temp);
}

getch();
}

Output:



EmoticonEmoticon

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:o
:>)
(o)
:p
:-?
(p)
:-s
8-)
:-t
:-b
b-(
(y)
x-)
(h)