Home › Forums › C Programming › program for fibonacci series › Reply To: program for fibonacci series
September 13, 2008 at 11:47 pm
#3457
berhane
Participant
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include<stdio.h><br /> void printfab(int,int,int);<br /> void main()<br /> {<br /> int i=0,j=1,n;<br /> printf("nEnter last limit ");<br /> scanf("%d",&n);<br /> printf("%d %d ",i,j);<br /> printfab(i,j,n)<br /> }<br /> void printfab(int i,int j,int d)<br /> {<br /> <br /> int temp;<br /> while(temp<d)<br /> { <br /> temp=i+j;<br /> j=temp;<br /> i=j;<br /> printf('n %d",temp);<br /> printfab(i,j,d);<br /> } <br /> |