Advertisement
Kyrexar

Sucesión de Fibonacci

Oct 25th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5.     int a=0, b=1, i;
  6.    
  7.     printf("%d %d ",a,b);
  8.    
  9.     for( i=1 ; i<46 ; i++ ){
  10.          if( i%2!=0 ) printf("%d ",a+=b);
  11.          else printf("%d ",b+=a);
  12.     }
  13.  
  14.     system("PAUSE");
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement