SampleExamples.com
All sample examples of Html, CSS, JavaScript, Java, C, CPP(C++), J2ME
Saturday, December 24, 2011
C Program to Generate Fibonacci Series
It is a sample c program to generate a Fibonacci series.
Program Source Code
#include"stdio.h"
#include"conio.h"
void main()
{
int a , b , c , i=1;
clrscr();
a=0;
b=1;
printf(“Fibonacci Series”);
printf(“%d\n”, a);
printf(“%d\n”, b);
while(i<=10)
{
c=a+b;
printf(“%d”, c);
a=b;
b=c;
i++;
}
getch();
}
Output
No comments:
Post a Comment
Dont SPAM
Newer Post
Older Post
Home
Popular Posts
Check Number is Armstrong in PL/SQL Programming
Generate Pascal Triangle in Java - Java Code for Pascal Triangle
Java Function Code to create Reverse Linked List of Singly Linked List (In memory pointer changes)
Java Applet Animation Program for Moving Car
Applets vs Applications - How Applets Differ From Applications
PL/SQL Example to find average of three numbers
Difference Between C++ and Java - Java Advantages over C++
Principles of Testing - Software Testing Principles
Java AWT vs SWING
C program for Binary Search
No comments:
Post a Comment
Dont SPAM