How to GCD in Scala - Code Snippet

How to perform 'GCD' in Scala.

example.scala
// Task: GCD
// Language: Scala

def 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