What will be the output of the following code segment in Lua
What will be the output of the following code segment in Lua?
x = 1
y = 3
do
local x = x
print(x)
x = x+y
do
local y = 5
local x = x+y
print(x)
end
print(x)
end
print(x)
Solution
According to the flow of given instructions after the execution the output will be
1
9
4
1
