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
what is difference between cobol and cobol/400
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
What is the utilization of copybook in cobol?
Name the sections present in data division.
What is the difference between PIC 9.99 and 9v99 in COBOL?
What is the difference between next sentence and continue in cobol programing language?
What guidelines should be followed to write a structured cobol prgm?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
) How do u handle errors in BMS macro?
example for sub strings ? and refernce modifications whit output pls
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
how do you define single dimensional array and multidimensional array in your cobol?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
how can i see junk values in dclgen or in hostvariable of comp ?