Without using move verb how to move one variable to another.
Answer Posted / raju
Let the variables and their values be A = 20 and B = 30
and we need to swap them as A = 30 and B = 20 without MOVE statement
BEFORE AFTER
A B A B
Way 1: COMPUTE A = A+B 20 30 50 30
COMPUTE B = A-B 50 30 50 20
COMPUTE A = A-B 50 20 30 20
Way 2: COMPUTE A = A*B 20 30 600 30
COMPUTE B = A/B 600 30 600 20
COMPUTE A = A/B 600 20 30 20
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
) How do u handle errors in BMS macro
What is rmode(24)
What is comp-1 and comp-2?
What is perform what is varying?
What is inspect in cobol ?
How are the next sentence and continue different from each other?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
Differentiate between structured cobol programming and object-oriented cobol programming.
How to remove 2 duplicate records and copy only one using job control language?
What is amode(24)?
how do you reference the printer file formats from cobol programs
Mention the guidelines to write a structured cobol program?
How many sections are there in data division in COBOL?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning