Thursday, August 22, 2013

A program that finds the Fibonacci series for first 30 numbers


   A program that finds the Fibonacci series for first 30 numbers.
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. long long int i,f1,f2,f;
  6. clrscr();
  7. f1=0;f2=1;
  8. printf("\n\n%llu %llu",f1,f2);
  9. f=0;
  10. for(i=3;i<=30;i++){
  11. f=f1+f2;
  12. printf(" %llu ",f);
  13. f1=f2; f2=f;
  14. }
  15. getch();

A program that finds the Fibonacci series for first 30 numbers


   A program that finds the Fibonacci series for first 30 numbers.
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. long long int i,f1,f2,f;
  6. clrscr();
  7. f1=0;f2=1;
  8. printf("\n\n%llu %llu",f1,f2);
  9. f=0;
  10. for(i=3;i<=30;i++){
  11. f=f1+f2;
  12. printf(" %llu ",f);
  13. f1=f2; f2=f;
  14. }
  15. getch();