Write a program to generate the Fibonacci series up to 'nth' given number using WHILE loop.
#include < stdio.h>
int main()
{
int f1=0,f2=1,nextTerm,i=3,n;
printf("Enter a Positive Number \n:");
scanf("%d",&n);
if (n == 1)
printf(ā%dā, f1);
else
if (n>=2)
{
printf("%d\t%d",f1,f2);
nextTerm = f1 + f2;
for(i=0; i < n-2 ;i++)
{
printf("\t%d", nextTerm);
f1= f2;
f2= nextTerm;
nextTerm = f1+ f2;
}
return 0;
}