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
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?
how to access the file from prodution from changeman tool and to submit a file to production
How do u write test cases?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
I have a File that has duplicate records. I need only those records that occur more than thrice.?
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
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
What are the pertinent COBOL commands?
what is the difference between COBOL2 AND COBOL390?
In COBOL, what is the different between index and subscript?
How arrays can be defined in COBOL?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
What is a report item?