null
US
Sign In
Sign Up for Free
Sign Up
We have detected that Javascript is not enabled in your browser. The dynamic nature of our site means that Javascript must be enabled to function properly. Please read our
terms and conditions
for more information.
Next up
Copy and Edit
You need to log in to complete this action!
Register for Free
38105352
Operator Precedence Rules in Ruby
Description
Think you know operator precedence rules? Test yourself on operator precedence rules in ruby with this short quiz.
No tags specified
ruby
programming
operator precedence
vectorlogic
a level
Quiz by
Domhnall Murphy
, updated more than 1 year ago
More
Less
Created by
Domhnall Murphy
over 3 years ago
2473
0
0
Resource summary
Question 1
Question
What is the output from the following ruby statement: puts (1 + 2 * 2)
Answer
5
6
3
4
Question 2
Question
What is the output from the following ruby statement: puts (4 * 6 / 2 * 2)
Answer
6
24
3
0
Question 3
Question
What is the output from the following ruby expression: puts (4 / 2 * 2 + 2 / 2)
Answer
4
2
3
5
Question 4
Question
What is the output from the following ruby statement: puts (5 + 10 % 3 + 6 / 2)
Answer
9
3
\(5 \frac{1}{2} \)
\(6 \frac{1}{2} \)
Question 5
Question
What is the output from the following ruby statement: puts (4 * 2 ** 2 * 2)
Answer
32
16
128
64
Question 6
Question
What is the output from the final ruby statement: c = 3 d = 4 puts (c or d == 7)
Answer
3
true
false
1
Question 7
Question
What is the output of the last ruby statement x = 5 && 4 puts x
Answer
true
false
5
4
Question 8
Question
What is the output of the last ruby statement x = 5 and 4 puts x
Answer
true
false
5
4
Question 9
Question
What is the output from the final ruby statement: a = false b = true ! a || b = false puts b
Answer
true
false
0
1
Question 10
Question
What is the output from the following ruby statement puts (13 & 10 << 1)
Answer
4
16
5
8
Question 11
Question
What is the output from the final ruby statement a = false b = true puts (a && b ? 'foo' : 'bar')
Answer
true
false
foo
bar
Question 12
Question
What is the output from the final ruby statement a = false b = true puts (a and b ? 'foo' : 'bar')
Answer
true
false
foo
bar
Show full summary
Hide full summary
Want to create your own
Quizzes
for
free
with GoConqr?
Learn more
.
Similar
Ruby+Rails - Borrador
Carlos Ortiz Gutierrez
Operadores logicos en ruby on rails
Pablo Soto
Objetos mutables e inmutables
Benjamin Villalpando
Tools and resources for computational thinking
Miguel Salamanca
What is programming language? Why python?
51143
Eloquent JavaScript
Marco s
Maleta Didáctica "Ipiales te llevo en mi corazón"
alejalove1708
HIPERTEXTO
RUBY PEÑALOZA
Condiciones Ruby on rails
Pablo Soto
RUBY
nangas_94
Parámetros Curriculares para la educación indígena
kawaii-sweet
Browse Library