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
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
How many sections are there in data division in COBOL?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What are the different open modes available in cobol?
how do you reference the ksds vsam file formats from cobol programs
Differentiate between structured cobol programming and object-oriented cobol programming.
Name the sections present in data division.
what is search and searchall?what is the diffrence between them?give an best example?
Explain the configuration section of a cobol program with examples of syntax.
Which Search verb is equivalent to PERFORM…VARYING?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
What is comp-1 and comp-2?
Write the code to count the sum of n natural numbers.