- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
local function isEven(number)
local code = "return "
for i = 1, number do
code = code .. "false"
if i ~= number then
code = code .. " =="
end
end
return load(code)()
end
print("Enter number: ")
if isEven(tonumber(io.read())) then
print("Number is even")
else
print("Number is odd")
end