Tuesday 28, March 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
 
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 : 2653
   
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 : 1968
   
arrays and pointers in c
An example code for arrays and pointers in c language....more »
Category : C Programs Hits : 1758
   
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 : 2899
   
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 : 5378
   
   
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 Design And Validation Of Computer Protocols  Ebook Design And Validation Of Computer Protocols
   
Download Sonic Forex Trading System  Ebook Sonic Forex Trading System
   
Download Step By Step Guide To Creating Your Own RSS Feed  Ebook Step By Step Guide To Creating Your Own RSS Feed
   
Download How To Really Make Money with Pay Per Click Affiliate Marketing Ebook How To Really Make Money with Pay Per Click Affiliate Marketing
   
Download  Beginners Guide To Free Article Marketing Ebook Beginners Guide To Free Article Marketing
   
     
Studiesinn.com 2017 All Rights Reserved.
 
Website Designed & Developed by TechXprtz