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



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 ..

Answer / sinha

c is the answer

Is This Answer Correct ?    9 Yes 0 No

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 ..

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

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 ..

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

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 ..

Answer / maneesh

d in the answer

Is This Answer Correct ?    1 Yes 4 No

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 ..

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

Post New Answer

More COBOL Interview Questions

what is the use of filler in cobol programing?

4 Answers   MAT,


what happens when a copybook variables are declared using include statement ?

3 Answers   IBM,


SUPPOSE I HAVE 60 CHARACTERS STING. IN THAT I WANT FIND OUT HOW MANY TIMES 'A'(ASSUME)WILL REPEATED AND I HAVE TO PASS 'E' IN PLACE OF 'A'ALONG THAT STRING.

2 Answers   Wipro,


What are decleratives in COBOL ?

1 Answers   Xansa,


Explain about level numbers?

3 Answers  






What is the difference between COMP & COMP-3 ?

2 Answers  


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

0 Answers   Accenture,


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

0 Answers   EDS,


What is the difference between a subscript and an index in a table definition?

3 Answers   TCS,


How you can delete a record from a ps file in cobol?

1 Answers  


01 A pic 9(100) find record length of it

6 Answers   TCS,


wirte a pgm in using files in which we hav 10 ,20,30 40...100 records in inputfile and i want them to be send to outputfile in reverse order. PLZ HELP ME OUT .........THIS IS A RECENT QUESTION IN IGATE..

5 Answers   iGate,


Categories