title: Initialize an array of integers in a loop
body: <p>I want to initialize an array of consecutive integers (say from 1 to 100) in Scala. </p>
  
  <pre><code>val N = 100
  val arr = new Array[Int](N)
  </code></pre>
  
  <p>What is the best way of doing this in both imperative and functional paradigms?</p>