+ 1

please I need your help. I can't answer this question.

What is the of this in ruby? What is the value of z? a = 13 b = a - 8 z = a%b

23rd Apr 2017, 2:31 PM
Ahmad Jafar Muhammad
Ahmad Jafar Muhammad  - avatar
4 odpowiedzi
+ 6
a = 13 b = 5 z is the remainder of 13/5 z = 3; % is called the modulo operator. It returns the remainder of a division.
23rd Apr 2017, 2:35 PM
Tim G
Tim G - avatar
+ 2
its simple none other than. you have to study about modulus operator that returns remainder after devision. that's why 13%5 results 3
23rd Apr 2017, 2:59 PM
Manender Dutt
Manender Dutt - avatar
+ 1
a = 13 b = 5 a%b=3
23rd Apr 2017, 2:40 PM
Azra Fadil
Azra Fadil - avatar
0
Thanks you all
23rd Apr 2017, 4:25 PM
Ahmad Jafar Muhammad
Ahmad Jafar Muhammad  - avatar