Question 1 of 25
Hints left: 3
Q1
Which sequence can be used to substitute the value of any ruby expression in a string?
Q2
Which of the following datatypes are valid in Ruby?
Q3
The downcase method changes the whole string to smallcase letters.
Q4
The .upcase and .capitalize method are used for capitalizing the whole string.
Q5
What is the range of octal notation (\nnn)?
Q6
What does %{Learn ruby language} represents?
Q7
What will we the output of the given code? I'am Learning RUBY Language.downcase
Q8
Why do we use =begin and =end?
Q9
What is the output of the given code? Ans=Ruby puts "#[Ans] is an oop language"
Q10
What is the output of the given code? print "What's your first name?" first_name=gets.chomp a=first_name.capitalize a=a.reverse puts"My name is #{a}"
Q11
How to comment a single line?
Q12
What will we the output of the given code? "I'am Learning RUBY Language".downcase
Q13
What is the output of the given code? "Ruby Language".length =begin calculate length =end
Q14
What is the output of given code? puts "what is your first name?" name=gets.chomp puts "what is your surname?" surname=gets.chomp
Q15
What will be the output of the given code? "I'am learning Ruby Language".length.reverse.upcase
Q16
What is the role of ! at the end of the capitalize method?
Q17
We use semicolon or parentheses after every print or puts statement.
Q18
Methods should not be written inside double quotes.
Q19
Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?
Q20
What will any variable evaluate to if it is of Boolean data type?
Q21
What does %x!ls! represents?
Q22
Which of the following are valid floating point literal?
Q23
What is the output of the given code? x, y, z = 12, 36, 72 puts "The value of x is #{ x }." puts "The sum of x and y is #{ x + y }." puts "The average was #{ (x + y + z)/3 }."
Q24
What does the notataion \b stands for?
Q25
Which of the following type of comments are valid in ruby?