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 happens if parmparameter passes zero bytes to the program

1667


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2337


Explain about different table spaces.

648


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

748


input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?

1872






What is a scope terminator give example?

657


What is the difference between external and global variables in COBOL?

813


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

2219


What the difference is between continue and next sentence?

659


Name the sections present in data division.

701


how can i see junk values in dclgen or in hostvariable of comp ?

2544


What is the difference between comp and comp-3 usage?

678


How do u write test cases?

1636


What is the problem of ordered sequential files access?

700


How to remove 2 duplicate records and copy only one using job control language?

753