title: Printing an array in scala
body: <p>I tried to take user input to an array and print it using scala. But there's something wrong.</p>
  
  <pre><code>def  abc()={
  var n:Int=0
  var m:Int=0
  var i:Int=0
  var j:Int=0
      print("Enter The Length Here:") 
      n=scala.io.StdIn.readInt
      var z= new Array[Int](n)
      while(n&gt;i){
          print("Enter The Num :")        
          m=scala.io.StdIn.readInt
          z[i]=m
          i+=1
      }
      for(j &lt;- 0 to n){
          print(z[j])
          j=j+1
      }
  </code></pre>
  
  <p>} 
  abc()  </p>