+ 14
Please explain me how % works!?
62 Respuestas
+ 37
% returns the remainder of a division.
9 % 3 = 0
9 % 2 = 1
11 % 3 = 2
+ 16
In usual way
9/2 = 4 r 1
In programming
9/2 = 4 (whole quotient)
9%2 = 1 (remainder only)
+ 8
This is the formula:
7%3 = ?
7:3 = 2,³ (Make the division)
3*2 = 6 (Make Divider * number on the left of the comma)
7-6 = 1 (Now do the substraction and you have your result)
7%3 = 1
Source: School
+ 4
a%b => a=bq+r , now "r" is our answer
like 9%3 => 9=3x3+0 , zero is our answer
like 26%6 => 26=6x4+2 , now 2 is our answer
i hope u understand this
source : school
+ 3
it shows only the remainder value...
+ 3
% is know as remainder calculation operator..
where we calculate the division of two numbers and calculate theri mode(remainder)
e.g.
10%2=0;
10%3=1;
10%4=2;
etc.
+ 3
it always gives a positive number as remainder
like
27%5=2
as 5*5=25
and 27-25=2
where 2 is a remainder
+ 3
10 % 2 == 5
It means When 10 is divided by 2 , It gives 0 as Remainder.
Basically '/' Stands for Quotient
'%' Stands for Remainder.
+ 3
%>the remainder.... its not like normal arithmetic math... 5/2=2.5...5 is the ans....
+ 3
% remains the remainder of the division
9%3=0
9%4=1
+ 3
IT IS EASY TO UNDERSTAND.....
EXAMPLE =
((int x;
x = 6%3;
cout<<x<<endl;))
in this .............
6 divides with 3
as we know that 3*2 = 6
so their is no remainder
hence the output will be = 0
******__________________******
/*IT MEANS THAT "MODULO(%)" MEANS HOW MUCH IS THE REMAINDER WHEN A NUMBER IS DIVIDED WITH OTHER/*
+ 2
it does not work with negative integers
+ 2
meaning of % this symbol is reminder
example :. 9/3 where %=0
19/3 where %=1
+ 2
it gives you the remainder when you divide
+ 2
% returns the remainder
suppose 9%3 will give you 0 as answer because when we divide 9 by 3 no remainder remain hence answer will be zero.
+ 2
Ok, lets say you have 18/4, how do you do this ? without , !
18 / 4 = 4 * 4 + 2 ! 18%4=2
780 / 3 = 250 * 3 + 30. 780%3=30
+ 2
Division and Remainders
Sometimes when dividing there is something left over. It is called the remainder.
Example: There are 7 bones to share with 2 pups.
But 7 cannot be divided exactly into 2 groups,
so each pup gets 3 bones,
but there will be 1 left over
"7 divided by 2 equals 3 with a remainder of 1"
7%3=1
<cite>https://www.mathsisfun.com/numbers/division-remainder.html</cite>
+ 2
HELLOOOOOOOOOOOOOOO!!!!
IT IS ALREADY EXPLAINED SEVERAL TIMES. CLOSEDDDDDD!!!!!!
+ 2
% is called Modulus. It is used to get the remainder of the division.
Example:
1). 10%3=1
1 is the answer since 1 is the remainder.
2). 10%4=2
3). 50%9=5
Ps.I hope you understand
+ 1
Got it. It that nuber that left after max devision?