TheBulgarianWolf

Kotlin Input/Output

Mar 13th, 2021
821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.34 KB | None | 0 0
  1. import java.util.Scanner
  2.  
  3. fun main(args: Array<String>){
  4.     //creates an istant which takes input from standart input(keyboard)
  5.     val reader = Scanner(System.`in`)
  6.     print("Enter a number: ")
  7.  
  8.     //nextInt() reads the next integer from the keyboard
  9.     var integer: Int = reader.nextInt()
  10.  
  11.     println("You entered $integer")
  12. }
Add Comment
Please, Sign In to add comment