I have this particular requirement where the increment in the loop variable is to be done by multiplying it with 5 after each iteration. In
Java we could implement it this way
In scala I was trying the following code-
But its printing the following output:
1 1
6 2
11 3
16 4
21 5
26 6
31 7
36 8
....
....
Its incrementing by 5 always. So how do I got about actually multiplying the increment by 5 instead of adding it.