Author Topic: struck in a loop  (Read 487 times)

Offline vaishaliravi

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
struck in a loop
« on: May 10, 2016, 01:09:52 AM »
I am new to this
I have got a problem in running this program

def count(a:Int):Int={
   
    var b:Int=0
    if( a<0){
       val a=(a:Int)=>a*1
 }
  else if(a==0){
      val a:Int=1
  }
   if(a>0){
      val a=(a:Int)=> a/10
      b=b+1
   }
        return b
  }//count
 can anybody help me out

Offline Akiyama

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: struck in a loop
« Reply #1 on: January 07, 2017, 03:27:11 AM »
Better yet, choose something simple like this.