Program To find Fibonacci Series

#include<conio.h>

#include<stdio.h>

void main()

{

int sum,a=0,i,j,n;

clrscr();

printf("Enter the value of 'n' to generate the fibonacci series");

scanf("%d",&n);

printf("%d",a);

printf("%d",j);

for(i=0;i<n;i++)

{

sum=a+j;

printf("%d",sum);

a=j;

}

getch();

}

Output

Enter the value of 'n'=9

0 1 1 2 3 5 8 13 ...........

Comments

Popular posts from this blog

Gove confirms mandatory housebuilding targets for councils will be abolished in face of Tory rebellion – UK politics live

Kotak Mahindra Bank Recruitment 2022 Released for Graduate Candidates And Apply Online