+ 2
6/2%2=1 ,please explain. I don't understand how they get 1?
3 Antworten
+ 3
what happened here is '/' has higher precedence over '%' so it first computes 6/2=3 and then it computes 3%2 will give us 1.
This is how precedence rule.
+ 3
because of operator precedence.
6/2%2
=3%2
=1
+ 2
it is very easy unless you don't know about reminder sign. 6/2=3 and 3%2=1. reminder of 3/2 is 1. Thee sign % represent reminder.