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
Explain how to differentiate call by context by comparing it to other calls?
What are the rules of the move verb?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
Discuss about changing dataset name in proc.
What are the different rules to perform a Search?
What are the pertinent COBOL commands?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
Which mode is used to operate the sequential file?
What is static and dynamic call in cobol?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What are the cobol coding sheets?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
How many bytes S(8) comp field occupy and its maximum value?