View Problem

Define a string containing variables and expressions

Given variables a=3 and b=4 output "3+4=7"
ExpandDiskEdit
ruby
puts "#{a}+#{b}=#{a+b}"
ExpandDiskEdit
ruby
puts "#{a}+#{b}=%s" % (a + b)
ExpandDiskEdit
erlang
A = 3, B = 4,
io:format("~B+~B=~B~n", [A, B, (A+B)]).
DiskEdit
clojure
(format "%d + %d = %d" a b (+ a b))
ExpandDiskEdit
go
a, b := 3, 4
fmt.Printf("%d+%d=%d\n", a, b, a + b)
ExpandDiskEdit
go
a, b := 3, 4
fmt.Println(a, "+", b, "=", a+b)
ExpandDiskEdit
fantom
echo("$a+$b=${a+b}")

Submit a new solution for ruby, erlang, clojure, go ...
There are 23 other solutions in additional languages (cpp, csharp, fsharp, groovy ...)