1. What is the output of the given code?
boolean_1 = 77<78
puts(boolean_1)
2. Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?
Correct Answer is : Fixnum
3. What does the notataion \b stands for?
Correct Answer is : Backspace
4. What is the sequence of ruby strings?
Correct Answer is : 8-bit bytes
5. What is the output of the given code?
my_string=Ruby
puts(my_string)
Correct Answer is : Error
6. Which of the following is not a valid datatype?
Correct Answer is : Timedate
7. What is the range of octal notation (\nnn)?
8. What is the output of the given code?
for num in 1...5
puts num
end
Correct Answer is : 1 2 3 4
9. What does the 1…10 indicate?
Correct Answer is : Exclusive range
10. What is the output of the given code?
for num in 1..3
puts num
for i in 1..2
puts num*i
end
end
Correct Answer is : 1 1 2 2 2 4 3 3 6
11. What is the output of the given code?
m= 0
loop do
m += 1
print m
break if m == 10
end
Correct Answer is : 12345678910
12. What is the output of the given code?
for num in 1..5
puts num*num
end
Correct Answer is : 1 4 9 16 25
13. What is the output of the given code?
for num in 1..3
puts num*num
m= 0
loop do
m += 1
puts m
break if m == 3
end
end
Correct Answer is : 1 4 9 16 25
14. What is the output of the given code?
loop do
m += 1
puts m
break if m == 3
end
Correct Answer is : Garbage values
15. What is the output of the given code?
i=1
for i in 5..10
puts i^2
end
Correct Answer is : 25 36 49 64 81 100
16. What does the 1..10 indicate?
Correct Answer is : Inclusive range
17. What is the output of the given code?
i=5
j=10
for i in 5..10 && j in 5..10
puts i**j
end
Correct Answer is : Syntax error
18. The .upcase and .capitalize method are used for capitalizing the whole string.
Correct Answer is : FALSE
19. What is the use of .capitalize method?
Correct Answer is : It capitalize on the first letter of the string
20. What is the role of ! at the end of the capitalize method?
Correct Answer is : It modifies the value stored in the variable