TheBulgarianWolf

Kotlin Operators

Mar 7th, 2021
766
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun main(args: Array<String>) {
  2.  
  3.     val number1 = 12.5
  4.     val number2 = 3.5
  5.     var result: Double
  6.  
  7.     result = number1 + number2
  8.     println("number1 + number2 = $result")
  9.  
  10.     result = number1 - number2
  11.     println("number1 - number2 = $result")
  12.  
  13.     result = number1 * number2
  14.     println("number1 * number2 = $result")
  15.  
  16.     result = number1 / number2
  17.     println("number1 / number2 = $result")
  18.  
  19.     result = number1 % number2
  20.     println("number1 % number2 = $result")
  21.  
  22.     val start = "Talk is cheap. "
  23.     val middle = "Show me the code. "
  24.     val end = "- Linus Torvalds"
  25.  
  26.     val resultt = start + middle + end
  27.     println(resultt)
  28. }
RAW Paste Data