+ 2
What is the meaning of a % b ?
I forgot it😂😂
9 ответов
+ 12
Almost same as divider, the difference is its tell the remainder from the value..
Example:
10 / 2 = 5 -- 10 % 2 = 0
29 / 3 = 9 -- 29 % 3 = 2
+ 9
it means remainder of a when divided by b like
19%4= 3
+ 6
a%b divides a by b and returns the remainder.
5%3=2
8%2=0
7%6=1
+ 4
% means modulus operator it works like division but returns the reminder of division e.g.
5 % 2 // 1
10 % 3 // 1
15 % 6 // 3
+ 2
get the remainder of (a) divided by (b)
+ 1
thank you
+ 1
remainder...here is the usecase in program.
https://github.com/Saga305/interview/blob/0c9fd02bcfb17b1d434cae0b3d1f99cada1996f8/19.cpp
+ 1
When % is used, it simply means return the remainder of the division operation.
For Example
5/3 is 1 remainder 2. This means 5%3 = 2
7/2 is 3 remainder 1. This means 7%2 = 1
+ 1
thank you