I was asked in HSBC interview following questions:

1. A string was given " techincal seminar on cobol language"
Interviewer asked me to calculate the number of vowels in
this string.

Answer Posted / ameen

here is an example for counting vowles in apple word..
apply the same code for your required string....
01 str pic a(5) value 'apple'.
77 cnt pic 9(1) value 0.
01 i pic 9(1) value 1.
procedure division.
perform varying i from 1 by 1 until i>5.
if str(i:1)="A" or "a".......write all vowels.
add+1 to cnt.
display cnt.

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a CICS code be a part of a copybook? If so, then what are the outcomes after compilation?

622


Explain the difference between link and xctl?

510


Can you define ppt and what are its uses?

615


Add a field to screen when what's the flow of impact?

2409


Name the cics command that gives the length of twa area?

568






what are the differences between and exec cics xctl and exec cics start command?

675


What is meant by a ‘Transid’ ?

628


Define cics interface block?

589


kindly specify the pic clause for the following:any bll cell, data type of length option field, hhmmss type of data fields?

671


What are the recoverable cics resources?

596


Explain the difference between a physical bms mapset and a logical bms mapset?

563


In the EIB block of CICS, highlight the names of few of the important fields?

579


Kindly specify the pic clause for the hhmmss type of data fields?

649


What is non-conventional programs?

584


Explain the difference between the into and the set option in the exec cics receive map command?

553