Full width home advertisement

HTML

Tech News

Ad

 Write a c program to display first 25 fibonacci numbers



#include<stdio.h>
#include<conio.h>
void main()
{
	int x,i;
	long int a=0,b=1,c;
	clrscr();
	printf("enter the range of fibonacci series: ");
	scanf("%d",&i);
	printf("%ld %ld\n",a,b);
	for(x=1;x<=i;x++)
	{
	c=a+b;
	a=b;
	b=c;
	printf("%ld\n",c);
	}
	getch();
}

Thank you for visiting seeya again

No comments:

Post a Comment

Bottom Ad [Post Page]