Skip to content

Instantly share code, notes, and snippets.

@rozer007
Created December 15, 2021 05:49
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/69a3c64e96cf9ce530938fcd45268d9c to your computer and use it in GitHub Desktop.
Save rozer007/69a3c64e96cf9ce530938fcd45268d9c to your computer and use it in GitHub Desktop.
Basics in Julia
Q1. How do we do string interpolation in julia?
ans: We use sigil($) in front of the variable name to interpolate it with the string.
Q2.How can we take input as an integer?
ans: We need to convert the string input to interger using parse function.
Q3.Can we define a global variable explicitly(with data type )in julia?
ans: No we cannot define a global variable explicitly.
Q4.What does the readline function retrun in julia?
ans: It takes the input from the user and return it as a string.
Q1. what will be the correct output of this statement?
println(Char(80),Char(69),Char(80))
a) AbA
b)Pep
c)PEP
d)pEp
ans: c)
Q2.Which is the correct way to convert a float to int?
a) int(2.10)
b) parse(int,2.10)
c) int(trunc(2.10))
d) none of the above
ans: c)
Q3.What will the be the output of this statement?
@printf("%.2s",12.333)
a) error
b) 12.3
c) 12.33
d) 12
ans: d)
Q4.Is this a correct statement?
d::Int16=10
a) Yes
b) No
ans: b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment