C Program to Display Fibonacci Series in a Given Range

The Fibonacci series is a series of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1. Here’s a simple C program to display the Fibonacci series up to a specified number of terms

Program :

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,i,n;
a=0;
b=1;
printf(“\nEnter n for how many times generate series : “);
scanf(“%d”,&n);
printf(“\nFibonacci Series : \n”);
printf(“%d %d “,a,b);
for(i=0;i<=n-3;i++)
{
c=a+b;
a=b;
b=c;
printf(“%d “,c);
}
getch();
}

Output :

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Basket
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare
Verified by MonsterInsights