|
|
|
|
Re: program to print the number of occurrence of a particular letter in a word. [message #319798 is a reply to message #319794] |
Tue, 13 May 2008 01:37 |
|
amritaseema
Messages: 47 Registered: January 2008
|
Member |
|
|
This is my viewpoint
the logic behind this program which i understand is:
frst we need to define two variables (one for string accept and other for holding the substring)
then we have to define a counter to 0
then we'll continue the loop till the length(string)
then we have to check the each letter which we can get from the substr(expression) with the given string
if the letter is matched with it
then the counter value is increase to 1
so in that way if its present mora than one time the counter value is accordingly increasing
for example:
let the string is eye...
it'll chk the occurance of e is 2 and y is 1
[Updated on: Tue, 13 May 2008 01:37] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|