0
please explain the problem with this code as i am new to kotlin
Fun main(args: Array<String>) { var x:Int= readLine()!!.toInt() var y:Int= x+x var z:Int= y+(y/10) println("your amount is" + z) }
1 Answer
0
Suppose you got 12,345 as input for integer <x>
Integer <y> is <x> + <x>
12,345 + 12,345 => 24,690
And Integer <z> is <y> + ( <y> / 10 )
24,690 + ( 24,690 / 10 )
24,690 + 2,469 => 27,159
Then output <z> on console screen, with a line break.
Except for the auto-cap side effects where 'fun' was written as 'Fun'; I didn't see any problem. Perhaps you can descibe the problem in the Description? â
What was the code supposed to do?
(Edited)



