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 / neelam
I agree with all of them who have answered 40.
It is a simple statement in cobol that
ADD A B TO C. (Means (A+B)+C moved in C)
Here,
ADD 40 X TO X ()
Value of X is 10
So, ADD 40 10 TO 10 (Gives 40+10+10 = 60)
Now, COMPUTE X = 3 * X - 40
Means X = 3 * 60 - 40 (Gives 180 - 40 = 140 )
Since PIC clause for X is 99, hence 140 can't be store in
variable X.
So answer is : 40
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
how do you define single dimensional array and multidimensional array in your cobol?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
I have a File that has duplicate records. I need only those records that occur more than thrice.?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What is the difference between comp and comp-3 usage?
What is the usage of comp fields in cobol?
What is rmode(24)
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
What is the problem of ordered sequential files access?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
How to remove 2 duplicate records and copy only one using job control language?
How you can characterize tables in cobol?
What is the LINKAGE SECTION used in COBOL?