You are on page 1of 1

www.eazynotes.com Gursharan Singh Tatla Page No.

/** Program to Print Fibonacci Series without Recursion **/

#include <stdio.h>

main()
{
int x, y, z, n, i;
x=0; y=1;

printf("\nEnter value of n: ");


scanf("%d", &n);

printf("\nFibonacci Series:\n\n");
printf("\n%d", x);
printf("\t%d", y);

for( i=0; i<n-2; i++)


{
z = x+y;
printf("\t%d", z);
x = y;
y = z;
}
getch();
}

You might also like