i need the code for this program in cobol.
2 + 1 = 3
4+3=7
6+5=11
8+7=15
10+9=19

Answer Posted / xxx

PERFORM VARYING X FROM 1 BY 1 UNTIL WS-ANS = 19
COMPUTE WS-ANS = (2 * X) + ((2 * X) - 1)
DISPLAY WS-ANS
END-PERFORM

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is inspect in cobol ?

806


Write a program to explain size error.

678


What is the problem of ordered sequential files access?

704


Write down the divisions of cobol program?

672


how do you reference the fixed unblock file formats from cobol programs

712






I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1808


how to move the records from file to array table. give with code example

2223


Mention the guidelines to write a structured cobol program?

621


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1525


What is the difference between Global and External Variables?

666


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

763


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2725


How do you define a variable of comp-1 and comp-2?

707


What is the difference between Call and a Link?

702


How do you reference the following file formats from cobol programs?

698