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


Please Help Members By Posting Answers For Below Questions

i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

897


how to access the file from prodution from changeman tool and to submit a file to production

6686


How do u write test cases?

1638


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

720


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

8167






What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

681


I have a File that has duplicate records. I need only those records that occur more than thrice.?

8657


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

2661


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1958


What are the pertinent COBOL commands?

2626


what is the difference between COBOL2 AND COBOL390?

2455


In COBOL, what is the different between index and subscript?

763


How arrays can be defined in COBOL?

665


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

711


What is a report item?

741