% operator | Sololearn: Learn to code for FREE!

+1

% operator

An example of % operator please

9/4/2019 5:01:04 PM

Phantom

5 Answers

New Answer

+5

https://www.sololearn.com/Discuss/82604/?ref=app

+2

3 % 2 = 1 6 % 4 = 2 16 % 8 = 0 % operator gives the remainder.

+1

% is mod operator for remain results of divide (10%2)=0 and (11%2)=1

+1

% is basically the modulus operator which returns the remainder. For example: 5%2=1

0

Thx a lot.