Skip to content

Instantly share code, notes, and snippets.

@rozer007
Created December 15, 2021 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rozer007/f2f4ff3a8161e62fd80ea7592db0bde4 to your computer and use it in GitHub Desktop.
Save rozer007/f2f4ff3a8161e62fd80ea7592db0bde4 to your computer and use it in GitHub Desktop.
Math and conditional in julia
Q1.Can we use increment(++) or decrement(--) operator in julia?
ans: We can't use increment or decrement operator, instead julia use shorthand assignment opeartor.
Q2.What does the second parameter in the random function defined?
ans: It is use to defined the dimension.
Q3.What is the syntax of ternary operator in Julia?
ans: Syntax: condition ? if true : if false
Q4.What is the exponential operator in julia?
ans: ^ is the exponential operator used in julia.
Q1. What will the output of this statement?
x=10
println(5x)
a) 1010101010
b) 50
c) 510
d) none of the above
ans: b)
Q2. What will the output of this statement?
println(+(1,1,2,+(2,3,4),1234))
a) Error
b) 1,1,2,9,1234
c) 1247
d) none of the above
ans : c)
Q3. What will the output of this statement?
v=10
if(v<10)
println(">")
elseif(v==10)
break
else
println("<")
end
a)<
b)>
c) __
d) error
ans: d)
Q4.What dimension array of random number will be created?
println(rand(1:2,2,3))
a) 1
b) 3
c) 2
d) 4
ans: c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment