Problem solving with C++ 7th ed. Walter Savitch.
Type: Posts; User: Dr.Tautology
Problem solving with C++ 7th ed. Walter Savitch.
Got it. That makes sense. Don't know why my book hasn't mentioned the difference between / and %.
I don't think we are understanding each other. The resut of 2%2, that is 2 divided by 2, is 1. This is obvious. What is not obvious is that it returns the remainder not the result. Maybe I am...
So it is basing the evaluation on whatever the remainder of the division is? 2%2=1 anywhere on planet earth.
I am completely new to programming and I have a elementary question about how to test for an even number. I understand that ((n%2)==0) tests this--because the number needs to be divisible by 2--but...