> For the complete documentation index, see [llms.txt](https://sron.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sron.gitbook.io/docs/loops-in-sron/for-loop.md).

# For Loop

#### 'for' is a looping attribute which is used to perform a set of instructions multiple times in a given range.

SRON provides **'for'** attribute to work on for loop. To provide a start and end point to the loop, **'range'** attribue is used.

#### Syntax of 'range':

```js
range : (variable = start_point, end_point, steps)
```

#### Examples:

```js
Correct Syntax:
    range : (Int i = 0, 10)
or
    range : (i = 0 , 10)

------------ 

Wrong Syntax:
    range : Int i = 0, 10
or
    range : (50)
```

By default, the steps are set as 1, so you don't need to specify it explicitly.

#### Sample Code to print 0 to 5 numbers.

```js
{
    name : Main
    for : {
        range : (Int i= 0, 6)
        console : ( i , '\n' )
    }
}
```

#### **OUTPUT :**

> 0\
> 1\
> 2\
> 3\
> 4\
> 5

***

#### Sample Code to print even number between 0 and 15.

```js
{
    name : Main
    for : {
        range : (Int i= 2, 15, 2)
        console : ( i , ' ' )
    }
}
```

#### **OUTPUT :**

> 2 4 6 8 10 12 14

***
