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

Answers were Sorted based on User's Feedback



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 / aj

do a loop on below equation . Varying n from 1 to required
value
(2n) + (2n-1)

Is This Answer Correct ?    11 Yes 2 No

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 / 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

More COBOL Interview Questions

What was removed from COBOL in the COBOL II implementation?

0 Answers  


What are differences between COBOL and java ? why we are giving more preference to COBOL ?

3 Answers   TCS,


how you will define variables length in cobol.

3 Answers   Temenos,


01 a pic x(6) value is abcdef 01 b pic x(3) move a to b wht will be the value in b ?

3 Answers   Patni,


TO abend the data sholud open in which mode? 1.new 2.old 3.mod 4.shr

1 Answers   MNC,






can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1 Answers  


where do u use low-value and high value in cobol

3 Answers   CGI,


I encountered an error when I move spaces to a numeric field?What should I do to move spaces on that field?help please.

9 Answers  


What are declaratives and what are their uses in cobol?

0 Answers  


copy 100 records without using ibm utilities

3 Answers  


The hierarchy of the execution of logical operators is (a) NOT AND OR (b) AND OR NOT (c) OR AND NOT (d) OR NOT AND

10 Answers   Huawei, IBM, TCS,


What are the ways you can generate a copybook?

2 Answers  


Categories