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 / mr.perfect
ADD A B TO C. (Means (A+B)+C moved in C)
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
Here , order of preference is - then * will come
so, it will calculate first X-40 = 60-40 =20
THEN, 3*20 == 60
Means X = 3 * 60 - 40 ==20
So answer is : 60
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
What is amode(31)
Describe the cobol database components?
How do you reference the fixed block file formats from cobol programs
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
IF I mention stop run in CICS what happens?
HOw can I get the negative sign while deduct high value from low value
what are decleratives in cobol?
What guidelines should be followed to write a structured cobol prgm?
What is redefines clause in COBOL?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What is rmode(any) ?
how to refer the data field?