0
Pls i don't understand how the answer of the question is 4?
var b=5; var a=20; a++; a--; var c =b % a; alert (c);
7 odpowiedzi
+ 6
var b=5;
var a=20;
a++; b--; // a = 21, b = 4
var c =b % a; // c = 4 % 21
alert (c); // 4
4 % 21 (modulo division):
21 goes into 4 0 times, there will be a remainder of 4
+ 4
It isn't?!
The answer of this will be 5...
5%20=5
It can be 4 if you do b-- instead of a--
+ 3
Definitely 5
Check it for yourself
https://code.sololearn.com/WBvF8m20vt3J/?ref=app
+ 1
Oh, i am sorry for the mistake, in place of a--, it is b--
+ 1
Thanks, gotten
0
I ran it in my text editor and the answer is 4
0
Pls can u explain the process