Code examples

Count parcels after a delivery

Add what came in, then subtract what went out.

Simple example

Start2 + 3 − 1
Result4
lesson.jl
function main()
    println(((2 + 3) - 1))
end

main()
Output
4
Advertisements

Everyday examples

Two boxes hold 6 and 4 parcels. Three parcels go out. How many are left?

Start6 + 4 − 3
Result7
lesson.jl
function main()
    first = 6
    second = 4
    sent = 3
    println(((first + second) - sent))
end

main()
Output
7
Run the example
Terminal
julia lesson.jl
Official documentation