Tuesday, 23 February 2016

Julia: while loop

while statement executes a block of statements until a particular condition is true

Syntax
while(condition)
         statement1
         statement2
         …..
         …..

end

julia> a=1;

julia> while(a<10)

           println("a=$a")

           a+=1

       end
a=1
a=2
a=3
a=4
a=5
a=6
a=7
a=8
a=9



Previous                                                 Next                                                 Home

No comments:

Post a Comment