## Introduction

Programmers are often encountered with a problem that is made up of mixing two or more concepts, and a good programmer knows how to approach the solution step by step. There is no need to come up with the most optimal solution in one go. We should first take time to build a general solution powered up by our first intuition.

No worries if you got stuck thinking about the solution for the Fibonacci half pyramid; remember, you either succeed or you learn. Today, we will learn about the Fibonacci half pyramid and discuss the approach to solving the problem in four different programming languages, i.e., __C__, __C++__, __Java__, and __Python__.

## Fibonacci Half Pyramid: Problem statement

Given the 'n' number, representing the n-number of rows (starting with row number 1), we need to construct an n-row half triangle such that the triangle elements follow the __Fibonacci Series in Python__ and the number of elements in a row is equal to the current row number.

### Example

Let's look at an example.

### Input

`n = 3`

### Output

```
1 // Row number 1
1 2 // Row number 2
3 5 8 // Row number 3
```

### Explanation

We start the Fibonacci series with 1 in the first row. Because the number of elements in row 1 equals 1, we move to the following line. Similarly, in row 2, when we get to the next two elements of the series, we move to row number 3.

This pattern continues until the number of rows printed equals the user input of required rows.

### Approach

**Step 1:** We will define initial variables for the 1st and 2nd elements of the series, 0 and 1.

**Step 2**: We will then take the input from the user, i.e., N.

**Step 3**: We will iterate through the 1st loop, N number of times starting from 1.

**Step 4**: We will nest another loop inside, which will loop from 1 to the outer loop variable.

**Step 5**: In the inner loop, we will update the third variable as the sum of precious two and edit the first variable's value as the second's and the second's variable value as the third's, i.e., (c = a+b, a = b, b = c).

**Step 6**: We will print the third variable as the last line of the inner loop.

**Step 7: **We will print a new line character out of the inner loop.

Now, let us discuss the above approach's code to solve the Fibonacci half pyramid problem in different languages.