C Introduction

Control Statement

- Program to check largest number
- Program to find factor of a number
- Program to find largest number among n numbers
- Program to print multiplication table
- An effective way to use of Else If
- Program to check vowel or not
- Program to find factorial of number
- Program to find the Fibonacci Series
- Program to check Palindrome or not

Functions

Array

Pointers

Structure and Union

Data Files

# Program to find the Fibonacci Series

In this example, We will learn a program to find the Fibonacci Series. Before that, You must have knowledge of the following topics

- Introduction
- For Loop

## Algorithm

This is the algorithm of program to find fibonacci Series

Step 1: Start

Step 2: Initialize variables i, n, t1 = 0, t2 = 1

Step 3: Initialize variable and assign t1 + t2

Step 4: Take input from the user and assign to variable n

Step 5: Assign i = 1

Step 6: Repeat this step until i <= n

Step 6.1: Print nextTerm variable

Step 6.2: t1 = t2

Step 6.3: t2 = nextTerm

Step 6.4: nextTerm = t1 + t2

Step 7: End

## Flowchart

This is the flowchart of program to find fibonacci Series

## CODE: Program to find the fibonacci Series

We will print fibonacci Series using for loop.

```
#include <stdio.h>
int main() {
int i, n, t1 = 0, t2 = 1;
int nextTerm = t1 + t2;
printf("Enter the number of terms: ");
scanf("%d", &n);
printf("Fibonacci Series: %d\t%d\t", t1, t2);
for (i = 1; i <= n-2; ++i) {
printf("%d\t", nextTerm);
t1 = t2;
t2 = nextTerm;
nextTerm = t1 + t2;
}
return 0;
}
```

The output of above program is

```
Enter number of terms : 10
0 1 1 2 3 5 8 13 21 34
```