Friday 20, April 2018
Welcome Guest, Register | Login  
      Home       Tutorials       Free Ebooks       Free Scripts       Tech News       Articles       About Us       Blog        Forum

  Print fibonacci series using c language

Here is a c language program which will take number of terms as input from user and prints the fibonacci series using c language loops.
Cut & Paste Script
#include<stdio.h>
 
main()
{
   int n, first = 0, second = 1, next, c;
 
   printf("Enter the number of terms\n");
   scanf("%d",&n);
 
   printf("First %d terms of Fibonacci series are :-\n",n);
 
   for ( c = 0 ; c < n ; c++ )
   {
      if ( c <= 1 )
         next = c;
      else
      {
         next = first + second;
         first = second;
         second = next;
      }
      printf("%d\n",next);
   }
 
   return 0;
}
   
     RELATED SCRIPTS
 
Bubble sort using c language
This program will sort an array using bubble sort in c language. c program for bubble sort, bubble sort in c, sorting an array using bubble sort in c language....more »
Category : C Programs Hits : 3765
   
Compare two strings using c
This program will input two strings and compare them. It will show both strings are equal, first string is greater than second or first string is less than second....more »
Category : C Programs Hits : 1700
   
pointer and there uses in c
Example code for pointer and there uses in c language....more »
Category : C Programs Hits : 1972
   
C program to show memory address of array elements and access array elements using pointers
This program will visualize the memory address of each array element and will show you how to access array elements using pointer....more »
Category : C Programs Hits : 3170
   
concatenate two strings c language
Here is an example code to concatenate two strings using clanguage....more »
Category : C Programs Hits : 3332
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download 10 Mistakes We Make at Networking Events and How To Avoid Them Ebook 10 Mistakes We Make at Networking Events and How To Avoid Them
   
Download How to be a Programmer: A Short, Comprehensive, and Personal Summary  Ebook How to be a Programmer: A Short, Comprehensive, and Personal Summary
   
Download Algorithms for Audio Watermarking and Steganography  Ebook Algorithms for Audio Watermarking and Steganography
   
Download tears of the mystic rose Ebook tears of the mystic rose
   
Download Computer Aids for VLSI Design  Ebook Computer Aids for VLSI Design
   
Studiesinn.com 2018 All Rights Reserved.