COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'
Answer Posted / sushree
id division.
prog-id. hello.
data division.
working-storage section.
01 ws-str pic A(6) value 'BOMBAY'.
01 ws-cnt pic 9(1).
01 ws-str1 pic A(1).
01 ws-str2 pic A(6) value space.
procedure division.
inspect ws-str tallying ws-cnt for all characters
display ws-cnt
perform until ws-cnt < 1
move ws-str3(ws-cnt:1) to ws-str1
string ws-str2 delimited by space
ws-str1 delimited by size
into ws-str3
compute ws-cnt = ws-cnt - 1
end-perform.
display ws-str3.
stop run.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
In COBOL, what is the different between index and subscript?
What is cobol?
Why did you choose to work with ibm mainframe cobol programming?
How many sections are there in data division in COBOL?
How to know whether the module is dynamical or statistical?
What are all the divisions of a COBOL program?
What is the problem of ordered sequential files access?
What is the utilization of copybook in cobol?
What are the pertinent COBOL
How arrays can be defined in COBOL?
How do get the result of your program directly on your pc?
What is rmode(24)
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)?
Explain how to differentiate call by context by comparing it to other calls?
What is static and dynamic call in cobol?