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
C Program For Pascal's Triangle - Pattern Pascal's Triangle in C Programming
Javascript for find greatest and smallest among three numbers
c program to check number is prime or not
C program to find transpose of a matrix
C Program to Check String is Palindrome or Not
Java Function Code to create Reverse Linked List of Singly Linked List (In memory pointer changes)
Check Number is Armstrong in PL/SQL Programming
Hello World program in Java
What is Multitasking and Multithreading?
No comments:
Post a Comment
Dont SPAM