Showing posts with label lucas series in c. Show all posts
Showing posts with label lucas series in c. Show all posts

Thursday, May 3, 2018

Lucas Series in C

A very simple program that I wrote to compute the Lucas series using C language.

I am currently accepting programming work, it project, school programming projects , thesis and capstone projects, IT consulting work and web development work kindly contact me in the following email address for further details.  If you want to advertise in my website kindly contact me also in my email address also. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.



Sample Program Output


Program Listing

lucas.c



#include <stdio.h>
#include <conio.h>

int main() 
{
     int a=0,b=0,c=0,d=0,i=0,n=0;
     
     printf("======  LUCAS SERIES IN C =====");
     printf("\n\n");
     printf("Created By Mr. Jake R. Pomperada, MAED-IT");
     printf("\n\n");
     printf("Give Number of Terms : ");
     scanf("%d",&n);
     
     printf("\n\n");
     
     a=1;
     b=1;
     c=1;
     
     printf(" %d %d %d",a,b,c);
     
     for (i=1; i<=(n-3); i++) {
         d = a + b + c;
         printf(" %d", d);
         a=b;
         b=c;
         c=d;
    }
    printf("\n\n\n\n");
    printf("===== END OF PROGRAM =====");
    printf("\n\n");
    system("pause");
}