0
Why does 5-3*3+3 equals 2 in ruby
ruby operators
6 Respostas
+ 2
because of operator precedence . it's same in all languages. it's rule of maths.!
5-3*3+3 ... first multiplication/division
it will be => 5-9+3 then addition/substraction
=> -1
+ 1
@VEdward, that equals -1... @akirkham What code are you using to come to that answer?
0
yeah that's right.. it should be -1! my bad -,3
0
https://code.sololearn.com/c3weD5Y62u52/?ref=app
check this code... it's giving -1 as answer in Ruby
0
that is why I posted solos try it comes to 2 I didn't think it was correct
0
man I checked it...it's giving -1 as answer