Fibbonacci Series

  • Uploaded by: Surya Tej
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Fibbonacci Series as PDF for free.

More details

  • Words: 110
  • Pages: 1
/* Write a C program to generate Fibonacci sequence * * Fibonacci sequence is 0 1 1 2 3 5 8 13 21 ... */ #include <stdio.h> void main() { int fib1=0, fib2=1, fib3, limit, count=0; printf("Enter the limit to generate the fibonacci sequence\n"); scanf("%d", &limit); printf("Fibonacci sequence is ...\n"); printf("%d\n",fib1); printf("%d\n",fib2); count = 2; /* fib1 and fib2 are already used */ while( count < limit) { fib3 = fib1 + fib2; count ++; printf("%d\n",fib3); fib1 = fib2; fib2 = fib3; } } /* End of main() */ /*----------------------------------------------------------Enter the limit to generate the fibonacci sequence 7 Fibonacci sequence is ... 0 1 1 2 3 5 8 -----------------------------------------------------------*/

Related Documents

Fibbonacci Series
May 2020 3
Series
May 2020 16
Series
July 2020 8
Series
November 2019 28
Series
November 2019 35
Series
June 2020 12

More Documents from ""

C_ass59
May 2020 7
Unit Iii
May 2020 9
C_ass50
May 2020 7
Fibbonacci Series
May 2020 3
Unit I
May 2020 10