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
what happens if parmparameter passes zero bytes to the program
How can you get the ksds file records into your cobol program?
Define cobol?
What are literals?
Write a program that uses move corresponding.
I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?
How do you reference the fixed block file formats from cobol programs
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
What is redefines clause in COBOL?
What is the difference between comp and comp-3?
What are the rules of the move verb?
How arrays can be defined in COBOL?
Which is not true about evaluate statement
Are you comfortable in cobol or jcl?