Friday 20, July 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
 
Printing triangle of numbers using c
Here is the source code for printing triangle of numbers using c language. In this example user will input a number, it will start from 1 and will go to the give number.
1
2 3
4 5 6
7 8 9 10...more »
Category : C Programs Hits : 2852
   
C program to join two strings without using strcat
This c language program will join two strings without using strcat string function....more »
Category : C Programs Hits : 2285
   
arrays and pointers in c
An example code for arrays and pointers in c language....more »
Category : C Programs Hits : 2022
   
Check the given year is leap or not using c
This program will input a year and check whether it is a leap year or not....more »
Category : C Programs Hits : 3589
   
Find Factorials using Recursion in c
This c program will use recursive function and calculate the factorial of given number....more »
Category : C Programs Hits : 1881
   
   
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 Guide To Cashing In On Ebay Ebook Guide To Cashing In On Ebay
   
Download How to Launch Your Music Career in 21 Days Ebook How to Launch Your Music Career in 21 Days
   
Download Viral Marketing Mechanics Ebook Viral Marketing Mechanics
   
Download How to Avoid Success at all costs Ebook How to Avoid Success at all costs
   
Download Data Structures and Algorithms with Object-Oriented Design Patterns in C#  Ebook Data Structures and Algorithms with Object-Oriented Design Patterns in C#
   
Studiesinn.com 2018 All Rights Reserved.