Re: How to find the greatest of two numbers without using the comparison operators?
- From: SkippyPB <swiegand@xxxxxxxxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 13:18:01 -0400
On Fri, 31 Aug 2007 13:09:34 GMT, "Michael Mattias"
<mmattias@xxxxxxxxxxxxxx> wrote:
"Aparajita" <aparajita.mohanty@xxxxxxxxx> wrote in message
news:1188561799.566239.84930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
or your response.Hi,
I want to find the greatest of two given numbers say 'A' and 'B.
I got an alternate solution,
like this
IF A-B IS POSITIVE
DISPLAY "A IS GREATER"
ELSE
DISPLAY "B IS GREATER"
END-IF.
What is your opinion on the above solution? Or if you find any
limitations or constraints with this code, please let me know.
I use three (3) tests for code:
1. Works correctly?
2. Relatively efficient?
3. Maintainable?
If 'yes' to all, it's a keeper.
MCM
You need a 4th in this case Michael.
4. Is this what the teacher wanted?
Regards,
////
(o o)
-oOO--(_)--OOo-
"I'm not afraid of dying. I just don't want to
be there when it happens."
--Woody Allen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove nospam to email me.
Steve
.
- References:
- How to find the greatest of two numbers without using the comparison operators?
- From: Aparajita
- Re: How to find the greatest of two numbers without using the comparison operators?
- From: Pete Dashwood
- Re: How to find the greatest of two numbers without using the comparison operators?
- From: Aparajita
- Re: How to find the greatest of two numbers without using the comparison operators?
- From: Michael Mattias
- How to find the greatest of two numbers without using the comparison operators?
- Prev by Date: Re: How to find the greatest of two numbers without using the comparison operators?
- Next by Date: Re: How to find the greatest of two numbers without using the comparison operators?
- Previous by thread: Re: How to find the greatest of two numbers without using the comparison operators?
- Next by thread: Re: How to find the greatest of two numbers without using the comparison operators?
- Index(es):
Relevant Pages
|