Posts

Showing posts from April, 2017

CODE ONLINE PLEASE VISIT ANY OF THE FOLLOWING....

Fibonacci series by using c

Image
//Tested in terminal #include<stdio.h> void main() { int a,b,c,d,i; b=0;c=1;printf("Enter the limit:"); scanf("%d",&a); {  printf("The series is\n"); if(a==1)    printf("0\n"); else if(a==2)    printf("0 \n1"); else   { printf("0\n1\n");    for(i=3;i<=a;i++)    {     d=b+c;     printf("%d \n",d);     b=c;     c=d;     }    } } }