# 4.1.2 Print Sequence

## ৪.১.২ নিম্নোক্ত ধারা গুলোর প্রতিটি পদ প্রদর্শন কর। (৬)

1. \[2] 1, 2, 3, 4, ........., N
   1. \[2.1] 1, 2, 3, 4, ........., 100 _(Similar)_
   2. \[2.2] ১ থেকে ১০০ পর্যন্ত প্রতিটি সংখ্যা প্রিন্ট কর। _(Similar)_
2. \[3] 1, 3, 5, 7, ........., N
   1. \[3.1] 1, 3, 5, 7, ........., 101 _(Similar)_
3. \[4] 2, 4, 6, 8, ........., N
   1. \[4.1] 2, 4, 6, 8, ........., 100 _(Similar)_
   2. \[4.2] ১ থেকে ১০০ পর্যন্ত সব জোড় সংখ্যা প্রিন্ট কর। _(Similar)_
4. \[5] 10, 20, 30, 40, ........., N
   1. \[5.1] 10, 20, 30, ......, 100 _(Similar)_
5. \[6] N, N-1, N-2, ........., 4, 3, 2, 1
   1. \[6.1] N, N-2, N-4, ........., 8, 6, 4, 2 _(Similar)_
   2. \[6.2] N, N-2, N-4, ........., 7, 5, 3, 1 _(Similar)_
6. \[7] 1, 1, 2, 3, 5, 8, 13, 21, 34, ........., N \[ফিবোনাচ্চি সিরিজ]

## সমাধান

### \[2] 1, 2, 3, 4, ........., N

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    scanf("%d", &n);
    for(i = 1; i <= n; i++){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

| Input | Output               |
| ----- | -------------------- |
| 10    | 1 2 3 4 5 6 7 8 9 10 |
| 5     | 1 2 3 4 5            |

#### \[2.1] 1, 2, 3, 4, ........., 100 _(Similar)_

#### \[2.2] ১ থেকে ১০০ পর্যন্ত প্রতিটি সংখ্যা প্রিন্ট কর। _(Similar)_

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    n = 100;
    for(i = 1; i <= n; i++){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="169">Input</th><th>Output</th></tr></thead><tbody><tr><td></td><td>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100</td></tr></tbody></table>

### \[3] 1, 3, 5, 7, ........., N

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    scanf("%d", &n);
    for(i = 1; i <= n; i += 2){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td>11</td><td>1 3 5 7 9 11</td></tr><tr><td>51</td><td>1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51</td></tr></tbody></table>

#### \[3.1] 1, 3, 5, 7, ........., 101 _(Similar)_

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    n = 101;
    for(i = 1; i <= n; i += 2){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="176">Input</th><th>Output</th></tr></thead><tbody><tr><td></td><td>1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101</td></tr></tbody></table>

### \[4] 2, 4, 6, 8, ........., N

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    scanf("%d", &n);
    for(i = 2; i <= n; i += 2){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td>10</td><td>2 4 6 8 10</td></tr><tr><td>50</td><td>2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50</td></tr></tbody></table>

#### \[4.1] 2, 4, 6, 8, ........., 100 _(Similar)_

#### \[4.2] ১ থেকে ১০০ পর্যন্ত সব জোড় সংখ্যা প্রিন্ট কর। _(Similar)_

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    n = 100;
    for(i = 2; i <= n; i += 2){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td></td><td>2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100</td></tr></tbody></table>

### \[5] 10, 20, 30, 40, ........., N

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    scanf("%d", &n);
    for(i = 10; i <= n; i += 10){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td>100</td><td>10 20 30 40 50 60 70 80 90 100</td></tr><tr><td>200</td><td>10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200</td></tr></tbody></table>

#### \[5.1] 10, 20, 30, ......, 100 _(Similar)_

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    n = 100;
    for(i = 10; i <= n; i += 10){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td></td><td>10 20 30 40 50 60 70 80 90 100</td></tr></tbody></table>

### \[6] N, N-1, N-2, ........., 4, 3, 2, 1

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    scanf("%d", &n);
    for(i = n; i >= 1; i--){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td>10</td><td>10 9 8 7 6 5 4 3 2 1</td></tr><tr><td>20</td><td>20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1</td></tr></tbody></table>

#### \[6.1] N,  N-2, N-4,........., 8, 6, 4, 2 _(Similar)_

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    scanf("%d", &n);
    for(i = n; i >= 2; i -= 2){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td>20</td><td>20 18 16 14 12 10 8 6 4 2</td></tr><tr><td>40</td><td>40 38 36 34 32 30 28 26 24 22 20 18 16 14 12 10 8 6 4 2</td></tr></tbody></table>

#### \[6.2] N,  N-2, N-4,........., 7, 5, 3, 1 _(Similar)_

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, i;
    
    scanf("%d", &n);
    for(i = n; i >= 1; i -= 2){
        printf("%d ", i);
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td>21</td><td>21 19 17 15 13 11 9 7 5 3 1</td></tr><tr><td>41</td><td>41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11 9 7 5 3 1</td></tr></tbody></table>

### \[7] 1, 1, 2, 3, 5, 8, 13, 21, 34, ........., N \[ফিবোনাচ্চি সিরিজ]

{% code lineNumbers="true" %}
```c
#include<stdio.h>
int main(){
    int n, a = 1, b = 1, c;
    
    scanf("%d", &n);
    
    printf("%d %d ", a, b);
    while( a + b <= n ){
        c = a + b;
        printf("%d ", c);
        a = b;
        b = c;
    }
    printf("\n");

    return 0;
}
```
{% endcode %}

**Sample Input Output:**

<table><thead><tr><th width="180">Input</th><th>Output</th></tr></thead><tbody><tr><td>233</td><td>1 1 2 3 5 8 13 21 34 55 89 144 233</td></tr><tr><td>2000</td><td>1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597</td></tr></tbody></table>
