View Problem

Perform an action if a condition is true (IF .. THEN)

Given a variable name, if the value is "Bob", display the string "Hello, Bob!". Perform no action if the name is not equal.
DiskEdit
python
if name == 'Bob':
print 'Hello, Bob!'
DiskEdit
csharp
if (name == "Bob") Console.WriteLine("Hello, {0}!", name);
ExpandDiskEdit
java
if (name.equals("Bob")) {
System.out.println("Hello, Bob!");
}
ExpandDiskEdit
fantom
if (name=="Bob") echo("Hello, Bob!")
DiskEdit
clojure
(def person "Bob")
(if (= person "Bob")
(println "Hello, Bob!"))

Submit a new solution for python, csharp, java, fantom ...
There are 18 other solutions in additional languages (cpp, erlang, fsharp, go ...)