Arithmetic operators

Assessment · November 25, 2022
fun main(){
    val a = 2
    val b = 10
  var sum = a+b
  var sub = a-b
  var mul = a*b
  var div = a/b
  var mod = a%b
  println("a+b = $sum")
  println("a-b = $sub")
  println("a*b = $mul")
  println("a/b = $div")
  println("a%b = $mod")
}
Output
(Run the program to view its output)

Comments

Please sign up or log in to contribute to the discussion.