Learn Java( Math: % )


#1

i just started today on code academy. i chose the java coding program and i got stuck on the ninth step. can anyone help me? Please… my code is this: int myRemainder = 14 % 7 i need to get a remainder of 2 which 2 numbers should i use??
thankyou

int myRemainder = 14 % 7


#2

Yep! Just give me a second to find the exact lesson for that code and I will try and explain what you should do to get your desired result! :smiley:


#3

thank you… waiting…


#4

but, i got stuck in the 11nth lesson now.


#5

So the key part to this lesson is you need the remainder of two numbers to equal 2 not just two numbers divided by each other to equal 2. If you were just dividing two numbers to equal 2 you could use 14 % 7 or 4 % 2 or etc. However, we want a remainder of 2. So now you just need to find 2 numbers that when divided by each other come up with a remainder of 2.


#6

You can make another topic for that question and me or someone else can help you on that one as welll :+1:


#7

thanks a lot… u helped me but i figured it out


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.