View previous topic :: View next topic
|
Author |
Message |
umesh khadaria
New User
Joined: 11 Sep 2008 Posts: 3 Location: india
|
|
|
|
I want to write a cobol code for comparinig 2 numbers but not to use any if condition. can anyone crack this????? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
You could use EVALUATE. |
|
Back to top |
|
|
umesh khadaria
New User
Joined: 11 Sep 2008 Posts: 3 Location: india
|
|
|
|
I dont want to use any conditions. is there any code so that by using on compute verb we can do this. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Maybe it will help if you describe exactly what you are wanting to accomplish.
Quote: |
I dont want to use any conditions. |
Of course you do - if we can believe your original post.
Quote: |
code for comparinig 2 numbers |
.
If you are playing some technical puzzle game, it would be good to mention this. This is most likely not for any business requirement.
Once we understand better, we may be able to provide other suggestions. |
|
Back to top |
|
|
umesh khadaria
New User
Joined: 11 Sep 2008 Posts: 3 Location: india
|
|
|
|
sure its a technical puzzle...
suppose i have 2 numbers A and B.
i want to find out which is greater. i cant use IF and Evaluate Statement.
one way i had found is sort them in a file and check there occurence.
is there any arithmatic computation by which we can achieve this.. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
... at the end of the string, You will find some kind of comparison,
( sort will have to compare things )
the only way to get away with it, given that the numbers are in the proper format,
is good old assembler, many arithmetic and load operations operation will set the condition code
I' ll leave to You to find out all the different behaviors,
two positive, two negatives, one of each |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
if it is a puzzle, You should have posted in a different forum
and be ready after a while to post also the answer.... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Maybe HOMEWORK is a better description of the thread. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Try Subtraction! |
|
Back to top |
|
|
|