input:- A 10 20 30 40 B 5 7 10 14 C 8 12 14 16....
output:- A = 100,B=36,C=50.
Here spaces are considered between numbers.
When we give input as above, the numbers should be added n
displayed.So please help me out.
Answer Posted / dineshj
coding for that Here.
W-S SEC.
01 A.
05 FILLER PIC X(80) VALUES SPACES.
05 NUM1 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
05 NUM2 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
05 NUM3 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
05 NUM4 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
01 NUM5 PIC 9(4).
PRO-DIV.
ACCEPT NUM1.
ACCEPT NUM2.
ACCEPT NUM3.
ACCEPT NUM4.
COMPUTE NUM5 = NUM1 + NUM2 + NUM3 + NUM4 .
DISPLAY A.
This is the coding for your answer plese check it out
If it is wrong. Pls do let me know...
| Is This Answer Correct ? | 1 Yes | 6 No |
Post New Answer View All Answers
what is difference between cobol and cobol/400
Explain the configuration section of a cobol program with examples of syntax.
how do you define single dimensional array and multidimensional array in your cobol?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
How do u write test cases?
Mention the guidelines to write a structured cobol program?
What is rmode(any) ?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
How do you reference the following file formats from cobol programs?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What is the compute verb? How is it used?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
how to move the records from file to array table. give with code example
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What are the different open modes available in cobol?