given the following:
77 A PIC 9V9 VALUE 9.5
77 B PIC 9 VALUE 9.
77 C PIC V9 VALUE 0.8
77 D PIC 9
77 E PIC 9
77 F PIC 9V999
what are the contenta of D E nad F after the following
statements are
executed:
COMPUTE F ROUNDED=A+C/B
MULTIPLY A BY C GIVING E
ADD B C A GIVING D ROUNDED
a.F=9.589 E=8 D=1
b.F=9.589 E=8 D=9
c.F=9.589 E=7 D=9
d.F=9.589 E=7 D=1
Answers were Sorted based on User's Feedback
Answer / ram g [mind tree]
c is the correct answer ...
the result will be like this
f = 9589
e = 7
d = 9
bcoz num truncation will happen in left.
for eg: if you try to store 123 in 01 x pic 9.
the value of x should 3 not 1.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / amaranatha reddy
this is AMAR(amaran.akg@gmail.com)9043264468
the correct ans: " C "
we 've 4 options, in that no need to check "f" value
next,about "E"
E pic 9(1)
A*C=E
9.5*0.8=7.6[9(1)=7]
hence E=7
now we go C&D for our solution
about "D":
---------
D=B+C+A=9+0.8+9.5=19.3
according to question
"D" i rounded
as per our answer data trunk-ed occur
for numeric literals data assigning is from right to left
-------------
(for integer positions)&left to right(for decimal positions)
------------------------------------------------------------
so Value of "D"=9
--------
hence solution is\ ""C"" \
----------
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ulhas
Its 100 % 'd' only.
Third statement 'ADD B C A GIVING D ROUNDED' gives
19.3 but as D is declared as pic 9. it will have only 1.
Is This Answer Correct ? | 1 Yes | 5 No |
Can we call a CICS program from a batch program or viceversa?If so, how?
What rules are to be followed while using the corresponding options?
A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.
What will happen if we generate GDG (+2) version without generating (+1) version?
how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).
Which of the following paragraphs is compulsory in every COBOL program? (a) SPECIAL-NAMES (b) PROGRAM-ID (c) FILE-CONTROL (d) OBJECT-COMPUTER
what is MSGLEVEL?
What is the maximum length of a field you can define using COMP-3 in COBOL?
How does IDMS communicate with CICS?
How do you set a return code to the JCL from a COBOL program?
how to resolve the file status 47.......
is this below syntax correct? CALL 'subprg' using A,B Please help