# I don't understand what this is asking!

• 01-30-2006
mabufo
I don't understand what this is asking!
I have a book here, and there are exercises after each chapter. In chapter two - which is basic data types, there is an exercise that tells me to do this:
Code:

```Here's an exercise for you puzzle fans. Write a program that will prompt the user to enter two different positive integers. Identify in the  output the value of the larger integer and the value of the smaller integer.```
I have no idea what that is asking me to do. The book is - ivor Horton's Beginning ANSI C++: The complete Language.
• 01-30-2006
Starr
It is saying that you let the user enter two positive integers (1,2,3,4,....) and then compare the two and then show the user which one was larger and which one was smaller. This is simple.
• 01-30-2006
Get two positive integers from user (you will use cin to get the input, which will be stored in 2 ints)
Output them in the format "a > b" (you will use cout for this)

The puzzle is determining the greater integer
• 01-30-2006
mabufo
Thanks fellas - I really just wasn't sure what it meant.
• 01-30-2006
7stud
Hi,

I learned C++ from that book, and I suggest that you skip the section on Bitwise Operators in Chapter 3. It is too difficult for beginners, and I think it should be in an appendix.

If you need specific help with sections in that book, I should be able to help.
• 01-31-2006
mabufo
Quote:

Originally Posted by 7stud
Hi,

I learned C++ from that book, and I suggest that you skip the section on Bitwise Operators in Chapter 3. It is too difficult for beginners, and I think it should be in an appendix.

If you need specific help with sections in that book, I should be able to help.

• 01-31-2006
jwenting
bitwise operators are an essential part of the language, if you don't understand them study harder.

Just because something isn't dead easy doesn't mean you're not supposed to know it.
• 02-04-2006
mabufo
Quote:

Originally Posted by jwenting
bitwise operators are an essential part of the language, if you don't understand them study harder.

Just because something isn't dead easy doesn't mean you're not supposed to know it.

I'm sure they are - but the problem is that the chapter gets very specific with binary code and hex values and I know next to nothing about binary and hex values and such... so it is VERY confusing to me. So I suppose once I get more comfortable with that sort of thing I'll re-visit it. :(
• 02-05-2006
jwenting
that's a shortcoming on the part of your teacher and/or study material then. They should have prepared you better.

Binary is easy. Remember there are two kinds of people, those who can count to 10 and those that can't, and you're halfway there.

Hex takes some getting used to, but it's just another numeric base too. Base 16 it is, 0-F instead of 0-9.
• 02-05-2006
laserlight
Quote:

that's a shortcoming on the part of your teacher and/or study material then. They should have prepared you better.
That is 7stud's point when giving the advice, if you did not notice. The book, according to 7stud, does not prepare beginners well when introducing bitwise operators.
• 02-05-2006
mabufo
I think it assumes that you have knowledge of that sort. Though I suppose I understand what the bitwise operators do - I don't think that my understanding of hex, binary and the like will allow me to make much use of them. That is, until I learn about the stuff.