Sample C Program To Count The Number Of Occurrences Of Any Two Vowels In Succession In A Line Of Text.
This program lets the user know the number of occurences of any two vowels in succession in the text passed in the program. For example, in the sentence “Please read the document carefully and then sign the gratuity form.” Such occurrences are ea, ea, ui.
char sent[ ] = "Please read the document carefully and then sign the gratuity form.";
int i, c;
for(i = 0, c = 0; sent[ i ] != '\0'; i++)
if( (sent[i] == 97 || sent[i] == 101 || sent[i] == 105 || sent[i] == 117 )&&(sent[i + 1] == 97 || sent[i + 1] == 101 || sent[i + 1] == 105 || sent[i + 1] == 111 || sent[i + 1] == 117))
printf("\nThere are %d occurences of two vowels in succession",c);
ALSO CHECK THESE C PROGRAMS:
- C Program to count the number of words, characters, alphabets, vowels, consonants and digit in a line of text.
- C Program to accept two string and compare the strings are equal or not.
- C Program to sort the entered numbers using bubble sort.
- C Program To Implement Minimum Spanning Tree Using Functions, Pointers & Structures.
- C Program To Implement 8 Queens Problem Using Arrays, Pointers & Functions.
- C Program To Implement Quick Sort Using Pointers, Functions & Arrays.
...Back To C Program Index.