I am trying to print the first 80 terms of fibonacci series but after certain range numbers appears to be negative.So, is this correct?
Here's the code:
#include <stdio.h>
int main() {
int i,first_term=0, second_term=1, next_term;
for(i=0; i<80; i++)
{
printf("%d, ",first_term);
next_term= first_term + second_term;
first_term=second_term;
second_term = next_term;
}
return 0;
}