Electrofriends

To count the number of vowels in a given string

by Ranjith | December 4th, 2008.

Here is a program to count number of vowels present in an entered sentence.
Logic:  Here variable ‘vowels’ is incremented whenever a vowel found in tracing. Logic behind this is very simple, that comparing each character to the set of vowels, predefined in an array. If this character is in the set of vowels then it [...]

Read More..

To count the number of words in a given string

by Ranjith | December 4th, 2008.

This is the program to count number of words in the entered sentence.
Logic: The logic behind this program is checking if the character in the sentence is a ‘blank’ and with the conditions that the next is not a blank character, or current character position is not equal to length of the sentence. If so, [...]

Read More..

Share and enjoy

    • Digg
    • Facebook
    • Technorati
    • StumbleUpon
    • Twitter
    • Reddit
    • del.icio.us
    • Yahoo! Buzz
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya