Skip to content

Instantly share code, notes, and snippets.

@dodyg
Last active June 11, 2022 08:58
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save dodyg/5823756 to your computer and use it in GitHub Desktop.
Save dodyg/5823756 to your computer and use it in GitHub Desktop.
Kotlin Programming Language Cheat Sheet Part 3

#Control Structures

##If statement

Kotlin if statement should look familiar with other language

fun main(args : Array<String>) {
  val total = 10
  
  if (total > 5){
      println("$total is greater than 5") 
  }else if (total > 10){
      println("$total is greater than 10")
  }else{
      println("$total is less than 6")
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment