answersLogoWhite

0

//Lucas series - 2,1,3,4,7,11,18

#include <stdio.h>

#define PRINTMAX 50

void lucas(int first, int second) //Prints 52 numbers

{

int count=1,total;

printf("%d\t%d\t",first,second);

while (count < PRINTMAX)

{

total = second + first;

printf("%d\t",total);

first = second;

second = total;

count++;

}

}

int main(void)

{

lucas(2,1);

return 0;

}

User Avatar

Wiki User

15y ago

What else can I help you with?