1. Zack, % and / are not the same operators. We should make that clear. They ARE related, but not the same. First, let's do some division practise.

There are ten apples, and three people. They want to divide fairly, but they dont want to break any into pieces. What happens? They each take 3, and leave one over. That one apple is the remainder. Now, in terms of C++, that equation is the following:

10%3=1;

10 modulus 3 equals 1. Or simply, if you divide 10 by 3 without decimal places, you'll have a remainder of 1.

Now, it happens that using number%2 will give you even/odd status. For example: 2%2=0. 2 divided by 2 will give you no remainder. 3%2=1. 3 divided by 2 will give you 1 remainder. 4%2=0. 4 divided by 2 gives no remainder. So that is the basis of your program.

2. Originally posted by ZakkWylde969
I'm glad I have your support. I'm just not understanding. You guys are explaining it over and over in the SAME words. MAybe a more detailed explanation would help other than it gives you the remainder divided by blah blah. I'm just not understanding.
Well you've stated you understand basic division, so you do know what a remainder is, right? You didn't answer my last question. Did you copy and paste that cout example I gave you? If so, the illustration should be quite clear.

Here is a basic division, think grade school, lesson for you:
Code:
```   ____
3 | 7```
Think back to grade school. This is how you wrote basic division problems. Given the above problem, what is your answer?

It should be:

"Seven divided by three is 2, with a remainder of one."

Drawn out:

3 x 2 = 6
7 - 6 = 1

Thus, you have a remainder of one when you divide seven by three.

Ok, well the "%" operator is used to give you that remainder. So:
Code:
```int number = 0;
int remainder = 0;

number = 7 / 3; //number now holds 2
remainder = 7 % 3; //remainder holds 1

//Thus:

cout << "Number times three: " << number * 3 << endl;
cout << "7 - 6 is " << 7 - 6 << "which is our remainder! See: " << remainder;```
If you can't follow that, give up. Programming is not for you.

Quzah.

3. parallelism to the max! We all posted the same post, within 2 minutes.

4. Originally posted by o0obruceleeo0o
Sorry Zakk, but there's just not many ways to explain it. Ok, you know division so you know that 10/5=2. You should also know that 10/5 doesn't have a remainder. If the remainder part is getting you, when dividing a remainder is what is left over. For example: 10/6=1 with a remainder of 4. 10/3=3 with a remainder of 1. 10/3 has a remainder of 1 because 3x3=9 and that leaves 1 left over(to make it = 10). After learning what a remainder is, please refer to my orignal post
Thanks a bunch. That pretty much cleared it all up for me.

5. Zakk, study the code that Quzah wrote for you. It is a very good and simple example and if you study it for a few hours it will all make sense to you . Maybe if you tried plugging in some different numbers in his code it will help as well...

6. ^^^^^^ Look at my above post.

7. Originally posted by ZakkWylde969
Thanks a bunch. That pretty much cleared it all up for me.
No problem, glad ya get it now . Postcount++;

8. Boy...I can't even remember using remainders at all...the first I remember using is fractions...I think that was 4th grade