+ 4
10%3 how to solve it?
Please help me solving it.
6 ответов
+ 5
Tahsin Ahmed
First of all you must know what this operator do.
% is an binary operator which means that it can be applied only if there are two values that is it can't be used with a single value.
Moreover this operator is called 'modulo' operator in python and returns the remainder we get after the division of those two numbers we used with this operator
Now suppose we have given 10%3
It just return the value we get as remainder after dividing 10 by 3.
So 10%3 will return the value 1.
I hope you understand.
If there is still any querry then mention me with that querry.
Thank you.
+ 6
% is a modulus operator in javascript thos will give you the remainder after dividing 10 by 3 so here when we divide 10 by 3 , 1 is left behind as a remainder so this will result in 1.
+ 3
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥
I think that
-10%3 should return the value -1 in JavaScript
See yourself:
https://code.sololearn.com/WfV0gIAbH22V/?ref=app
+ 3
😊😊😊Thanks to all.😊😊😊
+ 1
Tahsin Ahmed '%' this operatot is called remainder and when 10 divisible by 3 it gave the remainder 1