Consider the following COBOL entries
05 X PIC 99 VALUE 10.
ADD 40 X TO X.
COMPUTE X = 3 * X - 40.
The result in X is
Answer Posted / rama krishna
Answer is again 10.
Add 40 to x :
x + 40 : 10 + 40 = 50
X = 3*X - 40
3 * x = 50 * 3 = 150, but since x declared as PIC 99, 1
will be truncated from 150. so now the value of x would be
50. so 50 - 40 is again 10.
| Is This Answer Correct ? | 22 Yes | 6 No |
Post New Answer View All Answers
What is the Purpose of Pointer in the string?
what happens if parmparameter passes zero bytes to the program
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
how do you reference the variable block file formats from cobol programs
What is the difference between Call and a Link?
Difference between cobol and cobol-ii?
Which division and paragraphs are mandatory for a COBOL program?
What is the difference between structured cobol programming and object alternativelyiented cobol?
Which mode is used to operate the sequential file?
what are decleratives in cobol?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
What is comp-1 and comp-2?
Differentiate between structured cobol programming and object-oriented cobol programming.
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What are different data types in cobol?