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
Answer Posted / 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 |
Post New Answer View All Answers
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
Name the divisions, which are available in a cobol program?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
what happens if parmparameter passes zero bytes to the program
Can a Search can be done on a table with or without Index?
How many sections are there in data division in COBOL?
What is the usage of comp fields in cobol?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
example for sub strings ? and refernce modifications whit output pls
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
What are the various section in data division and briefly explain them.
What is the LINKAGE SECTION used in COBOL?
A table has two indexes defined. Which one will be used by the SEARCH?
what is the use of outrecord?
What is the difference between goback, stop run and exit program in cobol?