19. Write a program to generate first n number of Fibonacci series

#include<stdio.h>
#include<conio.h>
void main()
{
int n,a=0,b=1,c,i;
printf("Enter the number:");
scanf("%d",&n);
printf("0");
for(i=1;i<=n;i++)
{
c=a+b;
a=b;
b=c;
printf("%d",a,b);
}
getch();
}


#OUTPUT:


Comments

Popular posts from this blog