How to GCD in Kotlin - Code Snippet

How to perform 'GCD' in Kotlin.

example.kt
// Task: GCD
// Language: Kotlin

fun gcd() {
    // Implementation for GCD
    val result = ...; // Initialize variable
    // TODO: Implement core logic here
    // Step 1: Prepare data
    // Step 2: Process GCD
    println("Done");
}
AdSense Slot