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
Name the divisions, which are available in a cobol program?
Write a program to explain size error.
What are literals?
Write the code to count the sum of n natural numbers.
Explain about different table spaces.
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
) how do u code after getting data?
how do you reference the ksds vsam file formats from cobol programs
how do you reference the variable unblock file formats from cobol programs
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
How many bytes S(8) comp field occupy and its maximum value?
Difference between array and sub-script ?
how do you reference the esds vsam file formats from cobol programs
Which division and paragraphs are mandatory for a COBOL program?