0

Any help on this one I've tried my best but i can't find the answer

a=8 a/=3 puts 4%a

10th Jan 2018, 4:39 PM
Evelyn Baby
Evelyn Baby - avatar
2 Réponses
+ 1
First variable 'a' is initialized with 8. Then you divide it by 3 i.e 8 / 3 = 2. a/=3 is equivalent to a=a/3 Which is assigned again to variable 'a'. Then finally you calculate 4 % a which gives remainder of the divison so 4%2 will give 0 as there is no remainder. Hope it helps.
10th Jan 2018, 5:24 PM
Rishabh Agrawal
Rishabh Agrawal - avatar
0
a = 8 a= a/3 4%a = 0
10th Jan 2018, 4:57 PM
emmey
emmey - avatar