Simple four-operation calculator in Lua
Try some features, typically available from functional languages. For example, functions that is first class values.

local operators = {
    ["+"] = function(x,y) return x+y end,
    ["-"] = function(x,y) return x-y end,
    ["*"] = function(x,y) return x*y end,
    ["/"] = function(x,y) return x/y end
}

local function default()
    print "No such operator"
end

print("Choose numbers:")
print("Num1:")
local num1 = io.read()
print("num2:")
local num2 = io.read()
print("Choose operator: + / - / * / /")

local func = operators[io.read()] or default
print(func(num1,num2))

io.read()