Setup Julia and run your first program on Ubuntu.

Sanjjushri Varshini R
featurepreneur
Published in
Mar 11, 2022

1) Installation:

sudo apt-get install julia

2) Open a file and save the file name with the extension .jl

3) Type the following code:

variable = "Dog"print(variable)

4) Go to the particular directory where you saved the Julia file in the terminal.

5) Run the following command:

julia <filename>.jl

Output:

Dog%

Here are a few more examples you can try:

i) Function:

function changeNum()
x = "Dog"
print(x)
end
changeNum()

ii) Arithmetic Operations:

a = 1
b = 2
c = 3
sum = a + b
subtract = b - c
mult = b * a
divide = sum/mult
println(sum)
println(subtract)
println(mult)
println(divide)
sentence = string("Hello", " Tact!")
println(sentence)
mult_sent = "Hello" * " Tact!"
println(mult_sent)

Keep Exploring!

--

--