View Problem

Perform different actions depending on a boolean condition (IF .. THEN .. ELSE)

Given a variable age, if the value is greater than 42 display "You are old", otherwise display "You are young"
ExpandDiskEdit
scala
val age = 42
if (age > 42) println("You are old") else println("You are young")
ExpandDiskEdit
scala
println( "You are " + ( if ( age > 42 ) "old" else "young" ) )

Submit a new solution for scala
There are 33 other solutions in additional languages (clojure, cpp, csharp, erlang ...)