0
Can Anyone explain how to figure out 7%2
4 Respuestas
+ 1
7%2 is basically the remainders:
How many tines do 2 go into 7 (2 4 6), it goes in 3x and 1 is left to react it so the answer is 1.
When % is uses they are asking for the remainder, but when / is used they are asking how may time does this integer go into this integer.
int x = 5;
int y = 11;
int z = y/x; //z = 2
int u = y%x; /*u = 1 as it's 1 number away from the given integer */
+ 1
The '%' sign is what we called 'Modulus' operator or in other words, it's called the remainder... It summarize the 7/2, which is the answer is a float (6.5) but when we apply the law of division, 7 divided by 2 is 6 r 1.. So that 1 is the modulus no.
+ 1
It is a modulus operator ....to get the reminder....here 7%2....the reminder is 1 so by using this operator we got the answer as 1....😀
0
It is nothing but remainder
7=3(2)+1
7-Divident
2-Divisor
3-Quotient
1-Remainder