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 |
How to recover a deleted source physical file from library?
how to submit a jcl by cobol program. clear me with an example.
In CICS/VSAM every file that is accessed should be defined in FCT. we have CICS READ, WRITE, BROWSE commands for VSAM files. How does it work with DB2 tables. It know it has to do with the plan. Please expain with examples.
perform I from 0 by 1 until I=5?How maney times it will executes
What is EIBCALEN? Why it is used?
In the JCL, how do you define the files referred to in a subroutine ?
what is the minimum number of lines a Cobol program should have to successfully compile and run
What is the different between index and subscript?
Q:what is the difference between the variable length and fixed lenght.how it varies in the cobol.
how to know that the file has 300 records how to acess it?
What is the difference between comp and comp-3 usage? Explain other COBOL usage?s.
what is the advantage of using redefines instead of delaring the variables ?