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
What is the difference between binary search and sequential search?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
how do you reference the rrds file formats from cobol programs
What is static and dynamic call in cobol?
What is a scope terminator give example?
Explain how to differentiate call by context by comparing it to other calls?
Explain what you understand by passing by value.
How you can characterize tables in cobol?
what are decleratives in cobol?
What is link edit in cobol?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is the difference between external and global variables in COBOL?
Name the sections present in data division.
What are the different data types in cobol?
What is Pic 9v99 Indicates in COBOL?