I have started to learn Julia. And I made a simple program using the function to find the area of the square. The code is below
# Given the length of square
function areaOfsquare()
global s= input("Enter the length of side: ")
a = s*s
print("\n Area of square is $a")
end
areaOfsquare()
Error:
UndefVarError: input not defined
Stacktrace:
[1] areaOfsquare()
@ Main .\In[12]:3
[2] top-level scope
@ In[12]:8
[3] eval
@ .\boot.jl:373 [inlined]
[4] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1196
I tried global before the variable s but still getting the same error.