find the combination of vowel in a string c

Solutions on MaxInterview for find the combination of vowel in a string c by the best coders in the world

showing results for - "find the combination of vowel in a string c"
Francisco
27 Aug 2018
1#include <stdio.h>
2#include <string.h>
3
4void main ()
5{
6    char arr[100];
7    int i, count = 0;
8
9    printf("Enter array: ");
10    gets(arr);
11
12    printf("\nThe combination of vowels are: ");
13
14    for(i=0; i < strlen(arr); i++)
15    {
16        if((arr[i] == 'a' || arr[i] == 'e' || arr[i] == 'i' || arr[i] == 'o' || arr[i] == 'u')
17           && (arr[i+1] == 'a' || arr[i+1] == 'e' || arr[i+1] == 'i' || arr[i+1] == 'o' || arr[i]+1 == 'u' ))
18        {
19            count++;
20            printf(" %c%c ",arr[i], arr[i+1]);
21        }
22
23
24    }
25
26    printf("\n\nNumber of occurrences of two vowels in succession is %d",count);
27}
28