Code to perform if else operation in Kotlin?

All QuestionsCategory: KotlinCode to perform if else operation in Kotlin?
chetan shidling asked 4 years ago

I need short information.

1 Answers
chetan shidling answered 4 years ago

Here is the code to perform the if-else operation in Kotlin.
 
fun main(args:Array <String>){
var num1: Int = 3
var num2: Int = 9
var result: Int = 0
if(num1 > num2)
result = num1
else
result = num2
println(“The biggest number is $result”)
}
 
Output:
 
The biggest number is 9