+ 4

10%3 how to solve it?

Please help me solving it.

11th Jul 2020, 9:23 AM
Tahsin Ahmed
Tahsin Ahmed - avatar
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.
11th Jul 2020, 9:31 AM
Akshay Panwar
Akshay Panwar - avatar
+ 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.
11th Jul 2020, 9:28 AM
Ayush Kumar
Ayush Kumar - avatar
+ 3
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 I think that -10%3 should return the value -1 in JavaScript See yourself: https://code.sololearn.com/WfV0gIAbH22V/?ref=app
11th Jul 2020, 9:38 AM
Akshay Panwar
Akshay Panwar - avatar
+ 3
😊😊😊Thanks to all.😊😊😊
11th Jul 2020, 12:10 PM
Tahsin Ahmed
Tahsin Ahmed - avatar
+ 1
Tahsin Ahmed '%' this operatot is called remainder and when 10 divisible by 3 it gave the remainder 1
13th Jul 2020, 6:57 AM
Navneet Kaur💫
Navneet Kaur💫 - avatar