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
Write some characteristics of cobol as means of business language.
What are the various section in data division and briefly explain them.
Name the sections present in data division.
What is static and dynamic call in cobol?
Whats the difference between search & search ALL?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
Which is not true about evaluate statement
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
) what is the difference between AID and HANDLE AID?
What is the local-storage section?
How do we get current date from system with century in COBOL?
Define static linking and dynamic linking.
Explain the configuration section of a cobol program with examples of syntax.
Why occurs cannot be used in 01 level in COBOL?