Answers for "find the combination of vowel in a string c"

C
0

find the combination of vowel in a string c

#include <stdio.h>
#include <string.h>

void main ()
{
    char arr[100];
    int i, count = 0;

    printf("Enter array: ");
    gets(arr);

    printf("\nThe combination of vowels are: ");

    for(i=0; i < strlen(arr); i++)
    {
        if((arr[i] == 'a' || arr[i] == 'e' || arr[i] == 'i' || arr[i] == 'o' || arr[i] == 'u')
           && (arr[i+1] == 'a' || arr[i+1] == 'e' || arr[i+1] == 'i' || arr[i+1] == 'o' || arr[i]+1 == 'u' ))
        {
            count++;
            printf(" %c%c ",arr[i], arr[i+1]);
        }


    }

    printf("\n\nNumber of occurrences of two vowels in succession is %d",count);
}
Posted by: Guest on June-23-2021

Code answers related to "find the combination of vowel in a string c"

Code answers related to "C"

Browse Popular Code Answers by Language