and your problem being...?
freelancelote
Junior Poster in Training
89 posts since Aug 2008
Reputation Points: 34
Solved Threads: 2
the program counts the number of alphabets used in the word and display as output !!
I'm guessing that by "the number of alphabets" you mean the number of letters your word has. If I'm guessing wright then use length() method of the String class.
Hava a look at the String class and at the trails .
2. A man wanted to enter a club but did not know the password that was required. He waited by the door and listend, a club member knocked on the door, the door man said "twelve" member replied "6" and was let in. Second member came to the door, doorman said "six" the member replied "3" and was let in. now the man throught that he had heard enough and walked up to the door, doorman said "eight" the man replied "4" but he was not let in. What should he say? so that he gets in.
What do you mean by that? Is it some kind of joke I didn't get?
freelancelote
Junior Poster in Training
89 posts since Aug 2008
Reputation Points: 34
Solved Threads: 2
What do you mean by that? Is it some kind of joke I didn't get?
That is the example for his problem.
jasimp
Senior Poster
3,623 posts since Aug 2007
Reputation Points: 533
Solved Threads: 53
That is the example for his problem.
ah!, it was too late in the morning!
freelancelote
Junior Poster in Training
89 posts since Aug 2008
Reputation Points: 34
Solved Threads: 2
he should say 5, by the way.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
he should say 5, by the way.
ah! right! now I see why I never got into a club!
freelancelote
Junior Poster in Training
89 posts since Aug 2008
Reputation Points: 34
Solved Threads: 2
this is the answer about the count:
int counter (string s){
count=0;
for (int i=1;int i
Um, no... just no.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
this is the answer about the count:
int counter (string s){
count=0;
for (int i=1;int i
No offense but this was worthless.How about using the s.length().
It already is a function that returns the number of character. And your counter has bugs.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608