Wednesday 13 January 2016

Julia: comments

Comments in Julia, makes the program more readable.

Suppose you written thousand lines of program, with out proper documentation, after some time, for the developer of the application also, it is very difficult to figure out what was written.

By using comments, you can document your code at the time of writing program. Comments don't affect your program execution. 

Julia supports two types of comments.
a.   Single line comments
b.   Multi line comments

a. Single line comments
Single line comments starts with # symbol.

b. Multi line comment
Multi line comments enclosed in between #= and =#


hello.jl
#=
 Sample program to demonstarte the usage of comments.
 Author : Hari Krishna Gurram
 Date: 03-12-2015
=#

# Arithemetic operations
println("10+20= ",10+20)
println("10-20= ",10-20)
println("10*20= ",10*20)
println("10/20= ",10/20)
println("10%20= ",10%20)

$ julia hello.jl 
10+20= 30
10-20= -10
10*20= 200
10/20= 0.5
10%20= 10



Previous                                                 Next                                                 Home

No comments:

Post a Comment