What is valu of % | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is valu of %

22nd Aug 2017, 1:43 PM
firoj
8 Answers
+ 5
it is used to get reminder of a number lets says you have 14 as a number and you want to see what is remained after dividing by 3 14%3 ==> 14 -( 3x4) ==> 14 - 12 = 2 14%3 will give you 2 21%5=1 3%2=1 49%10=9 101%100=1 25%5=0
22nd Aug 2017, 1:50 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
+ 4
for example: 5%2=1 14%4=2 50%10=0 33%10=3 I hope this example help u :)
22nd Aug 2017, 1:48 PM
AL.The.Flame!
AL.The.Flame! - avatar
+ 4
thanks all of you for solve my problem
23rd Aug 2017, 6:06 AM
firoj
+ 3
% is not a value, it's rather an opporator. It returns the rest of the value once it's devided, example: 7 % 2 = 1 because 7 / 2 = 3 with a rest of 1. Another example: 12 % 10 = 2 • 12 / 10 = 1 with a rest of 2 13 % 7 = 6 • 13 / 7 = 1 with a rest of 6 https://code.sololearn.com/c1bKBG63l3Zy/?ref=app
22nd Aug 2017, 1:51 PM
Limitless
Limitless - avatar
+ 3
% is not a value. It's the remainder operator to find the remainder after an integer division...
30th Aug 2017, 2:32 PM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 2
ali, scroll a bit up to see my explanation and examples on Modulo (%)
28th Nov 2017, 7:49 PM
Limitless
Limitless - avatar
0
To give reminder in division
26th Aug 2017, 2:54 PM
Collins Kibet Meli
Collins Kibet Meli - avatar
0
friends any on can help me with modulo !!! i can't understand it////
28th Nov 2017, 6:51 PM
ali