Hi,
You can use for loop in scala using this code below:
scala> for (i <- 1 to 5)println(i)
![](https://www.edureka.co/community/?qa=blob&qa_blobid=10735917762593889605)
And also you can do the reverse of this by using this code:
![](https://www.edureka.co/community/?qa=blob&qa_blobid=18426031731890581017)
Just you need to add by -1 in that particular code and you can see the result in a reverse manner.