Generate the Fibonacci Series starting from any two numbers.

 #include <stdio.h>


int main()

{

    int f,s,t,i;

    printf("enter value of first number");

    scanf("%d",&f);

     printf("enter value of second number");

    scanf("%d",&s);

    for(i=0;i<5;i++){

    t=f+s;

    printf(" %d ",t);

    f=s;

    s=t;

    }


    return 0;

}

No comments:

Post a Comment

Programming in C Language

  PROGRAM LIST TO BECOME PRO IN C    😍😍😍            PRACTICE SETS                                                        UNIT -1  👇   IN...