0% found this document useful (0 votes)
26 views2 pages

Fibonacci Series

This lab report describes a C program to print the Fibonacci series up to a given number. The program takes user input for the number, initializes the first two Fibonacci numbers to 0 and 1, calculates the next number as the sum of the previous two and prints the series.

Uploaded by

nasty.nahid420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Fibonacci Series

This lab report describes a C program to print the Fibonacci series up to a given number. The program takes user input for the number, initializes the first two Fibonacci numbers to 0 and 1, calculates the next number as the sum of the previous two and prints the series.

Uploaded by

nasty.nahid420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Port City International University

Lab Report. : Write a C program for Fibonacci series.


Report No. : 09

Submitted To Submitted By
Teacher/Professor: Name: Md. Jahidul Hossen Munna
Tanvinur Rahman Siam
Department: CSE Program: CSE

Course Name: Computer ID No. : CSE 032 08352


Fundamentals and Programming
Techniques (Sessional)
Course Code: CSE 112
#include <stdio.h>
int main()
{
int num,a=0,b=1,c;
printf("Enter a number ");
scanf("%d",&num);
for(int i=0; i<=num; i++)
{
printf("%d ",a);
c=a+b;
a=b;
b=c;
}
return 0;
}

You might also like