Showing posts with label Sample Code for Fibonic Series. Show all posts
Showing posts with label Sample Code for Fibonic Series. Show all posts
Wednesday, April 18, 2012
Tuesday, April 10, 2012
C Program for generate Fibonacci
/*******<soeasyprograms.blogspot.in>*****/
//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();
}
Output of this Program is:
Subscribe to:
Posts (Atom)

