study the following
01 A PIC 99V0 VALUE 5
01 B PIC 9V9 VALUE 6
01 C PIC 99V9 VALUE 2.5
01 D PIC 99 VALUE 3
COMPUTE A ROUNDED B C = A+B*C/D
ON SIZE ERROR PERFORM PRINT-ERROR
the comments of A.B.C after execution of the above
statement are
a.A=10 B=0 C=10
b.A=10 B=9.9 C=9.9
c.A=10 B=0 C=9.9
d.A=10 B=6 C=10
Answers were Sorted based on User's Feedback
Answer / kamesh
5+6*2.5 div 3=10 so a=10,b=0 bcz truncated 1.and c= 10.
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / karthik
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
DATA division.
WORKING-STORAGE SECTION.
01 A PIC 99V9 VALUE 5.
01 B PIC 99V9 VALUE 6.
01 C PIC 99V9 VALUE 2.5.
01 D PIC 99 VALUE 3.
PROCEDURE DIVISION.
COMPUTE A ROUNDED B C = A+B*C/D
ON SIZE ERROR PERFORM PRINT-ERROR.
DISPLAY A.
DISPLAY B.
DISPLAY C.
STOP RUN.
PRINT-ERROR.
DISPLAY "ERROR".
o/p
10.0
10.0
10.0
Is This Answer Correct ? | 2 Yes | 0 No |
what is a zoned decimal data type and how it will be stored?
2)Where the Plan is located in CICS-DB2?
How to read records from flat file in reverse order through COBOL program?
14 Answers Accenture, Broadridge, IBM, MAT, Polaris, SPIC, Syntel, TCS, Wipro,
1.Can we define condition-name conditions in FD entry.
How do get the result of your program directly on your pc?
diffrence between z(2) and z9(2)
i WANT ALL ERROR codes IN CICS and DB2
Can you please let me know the centre name of INS certification in Kolkata.
What is the default value of DISP for temp datasets
wht is packed decimal in cobol
What is the difference between perform … with test after and perform … with test before?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic