# Meet the Kotlin Programming Language

Apr 10 2024 · Kotlin 1.9, Android 14, Android Studio Hedgehog

## Lesson 03: Using Operators

### Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Open the Starter project in the 03-using-operators directory of the m3-kpl-materials repo in Android Studio Hedgehog or later.

``````val sum = 3+2
println(sum)
``````
``````val difference = 10 - 2
println(difference)

val product = 3 * 2
println(product)

val quotient = 6 / 2
println(quotient)

val remainder = 11 % 2
println(remainder)
``````
``````// 1
var count = 5
// 2
println(count)
// 3
count += 1
println(count)
// 4
count -= 3
println(count)
// 5
count *= 2
println(count)
// 6
count /= 2
println(count)
``````
``````// 1
count ++
// 2
println(count)
// 3
count--
// 4
println(count)
``````
``````// 1
val age = 14
// 2
if (age < 16) {
// 3
println("You can't drive")
// 4
} else {
println("You can drive")
}
``````
``````// 1
val a = 10
val b = 20
val c = 30

// 2
val isALargest = a > b && a > c

// 3
println("It is \${isALargest} that a is the largest number")
``````
``````// 1
val raining = true
// 2
val temperature = 35

// 3
val carryUmbrella = raining || temperature > 30
// 4
println("Carry an umbrella: \$carryUmbrella")
``````
``````// 1
val isTrue = true
// 2
println(!isTrue)
``````
``````val hello: String? = null
println(hello?.length)

val message = hello ?: "value is null"
println(message)
``````