Fibonacci Number using Loop!

 #include <stdio.h>


int main (){

int i,a=0,b=1,c;

int num;

scanf("%d",&num);

//printf("%d %d ",a,b);

for(i=1;i<=num;i++){

printf( "%d ",a);

c = a + b;

a = b;

b = c;

}

c = 0;

return 0;

}

Comments