In VS Code Extension, I was trying to run a simple Julia program that can prompt for inputs of two numbers, then shows the sum of numbers like below:
print("Enter the first number: ")
a = parse(Float64, readline())
println("First number is $a")
print("Enter the second number: ")
b = parse(Float64, readline())
println("Second number is $b")
println("Hence the sum of $a and $b is $(a+b)")
When I run this program (Shift + Enter
), after the first prompt message printed in REPL, Julia is taking first input which is not the first number actually and I need to provide the input in REPL once more which gives the output like below:
julia> 23
23
First number is 23.0
Enter the second number: 58.9
Second number is 58.9
Hence the sum of 23.0 and 58.9 is 81.9
julia> 23
In VS Code TERMINAL (REPL), can this output look more appropriate something like below?
julia> Enter the first number: 23
First number is 23.0
Enter the second number: 58.9
Second number is 58.9
Hence the sum of 23.0 and 58.9 is 81.9