1. Take an input n. Print the triangular pattern shown below using the value of n.
(Output
samples are shown below)
n = 1 n = 2 n = 3 n = 4 n = 5
* * * * *
** ** ** **
* *** *** ***
** **** ****
* *** *****
** ****
* ***
**
*
[Observe and compare the values of n with corresponding outputs to understand the
pattern.]
2. Take an input n. Print a diamond pattern using the value of n. (Output samples are
shown below)
n = 1 n = 2 n = 3 n = 4 n = 5
* * * * *
* * * * * * * *
* * * * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*
[Observe and compare the values of n with corresponding outputs to understand the
pattern.]
3. Print the first 100 fibonacci numbers.
To know more about fibonacci series:
https://www.mathsisfun.com/numbers/fibonacci-sequence.html
First 10 numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 …
4. Solve the following problem: