Monday 20, February 2017
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

  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
 
Check number is prime or not using c

Here is a code example to check the number is prime or not a prime number. It will input number from user. If number is prime, it will print "Number is prime" on screen and if number is not prime it will print "Number is not prime".

...more »
Category : C Programs Hits : 5360
   
arrays and pointers in c
An example code for arrays and pointers in c language....more »
Category : C Programs Hits : 1743
   
pointer and there uses in c
Example code for pointer and there uses in c language....more »
Category : C Programs Hits : 1776
   
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 : 1554
   
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 : 2967
   
   
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 BUTTERFLY MARKETING LEAKED CHAPTER  Ebook BUTTERFLY MARKETING LEAKED CHAPTER
   
Download How To Start The Life Of Your Dreams Ebook How To Start The Life Of Your Dreams
   
Download Powerful Webmaster Resources Ebook Powerful Webmaster Resources
   
Download Mammoth Myspace Secrets Ebook Mammoth Myspace Secrets
   
Download Sonic Forex Trading System  Ebook Sonic Forex Trading System
   
     
Studiesinn.com 2017 All Rights Reserved.
 
Website Designed & Developed by TechXprtz