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 many bytes do SPPPP999 will store?
What is the difference between write & move in COBOL?
How to print 10 to 1 if the input have only 10 digit number?
How can we know that cobol program is using report file or simple file....?
What is an in-line perform ?
Difference between cobol and cobol-ii?
What is the difference between NEXT SENTENCE and CONTINUE?
If my file contains 100,000 records and job abended at 55,000th records processing then how can i restart job from that record onward by ignoring that record. I can not edit the file as file size is big and it is getting browse substituted?
When can the USING phrase be included in the call statement ?
In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?
What is a scope terminator? Give examples.
How do you compile cobol program..?