Pages

Sunday, 20 May 2012

program to print Series by user


82./*Write a program to print Series by user*/

#include<stdio.h>
#include<conio.h>
main()
{
            int f=0,f1=1,f2=0,n;
            clrscr();
            printf("Enter fast range");
            scanf("%d",&n);
            while(f1<n)
            {
            printf("%d",f2);
            f=f1+f2;
            f1=f2;
            f2=f;
            }
            getch();
}

OUTPUT

            Enter fast range : 5
            0 1 1 2 3 5

No comments:

Post a Comment