"I am writing code for fibonacci series and after 44th term in series, i start getting negative values in series Why?
#include <stdio.h>
int main(void)
{
int i, n , t1 = 0 ,t2 = 1 ,next;
printf("Enter the number of terms for series:");
scanf("%d", &n);
while(i<=n){
next = t1 +t2 ;
t1 = t2;
t2 = next;
printf("%d\n", next);
i++;
}
return 0;
}
" expected output is fibonacci series upto any number of term but after 44th term I start getting negative values in series"