Results 21 to 26 of 26
 10252010, 05:34 AM #21Moderator
 Join Date
 Feb 2009
 Location
 New Zealand
 Posts
 4,574
 Rep Power
 12
Java Code:26%6 = ??? 19 20 21 22 23 24 25 26 13 14 15 16 17 18 7 8 9 10 11 12 1 2 3 4 5 6 _ _ _ _ _ _ 1 2 3 4 5 6
When you put 26 things into 6 stacks two things are left over. 26%6=2.
is it 3 ?
Are you seriously saying that you can put 6 things into 26 stacks and end up with 3 left over?
Java Code:_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
Forget decimal division and the number you get to the right of the decimal points. That has nothing to do with %.
And be careful about the order of the operands. 26%6 and 6%26 are different things.
 10252010, 05:51 AM #22Member
 Join Date
 Oct 2010
 Posts
 23
 Rep Power
 0
ok , I think i got it , so remainder is 9 ?
And if 5 % 26 and the remainder is 10 ? is it right ?
Thanks
 10252010, 07:09 AM #23Member
 Join Date
 Apr 2010
 Posts
 22
 Rep Power
 0
i am sorry i am new to this and shouldn't recommend anything
but i think you have to solve this first using simple maths and then you can think in terms of a programming language.
If you cant solve a question on paper, likely chances you wont be able to do it in a program.
its simple multiplication..
if u have 7 % 2 ==> you do 2*3 =6 therefore remainder is 1.
if you have 11%5 ==>you just take the value of the right side (5) calculate it till you get below or equal the value on left side (11).
so in this case 5 * 3 = 15 so we are going above the value of left side.. therefore its 5*2 = 10
and remainder is again 1....
 10252010, 07:10 AM #24
 10252010, 07:50 AM #25
This is beginning to look suspiciously like trolling. And if the OP's understanding is genuinely so flawed, s/he needs a math forum, not a Java forum.
db
 10252010, 08:39 AM #26
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,728
 Blog Entries
 7
 Rep Power
 21
On what planet? The Java modulo operator is defined as:
Java Code:int javaMod(int a, int b { return a  b*(a/b); }
Java Code:int javaDiv(int a, int b) { return (a < b)?0:(1+javaDiv(ab, b)); }
kind regards,
Jos
Similar Threads

Program in Java To calculate GCD of n numbers.?
By ankitsinghal_89 in forum New To JavaReplies: 4Last Post: 02152011, 10:23 AM 
how to discard remainder on division?
By RobertF in forum New To JavaReplies: 9Last Post: 03132009, 01:20 PM 
[SOLVED] Modulus/Remainder results
By antgaudi in forum New To JavaReplies: 9Last Post: 10132008, 04:49 AM 
BigInteger remainder results in zero
By perito in forum New To JavaReplies: 1Last Post: 03212008, 05:07 PM 
Calculate Tax in java
By toby in forum New To JavaReplies: 2Last Post: 07302007, 10:03 AM
Bookmarks