Skip to content

Commit f7e478a

Browse files
committed
consecutive vowel count in string c-basics
1 parent c9fcf8a commit f7e478a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

stringconsecutivevowelcount.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include<stdio.h>
2+
#include<string.h>
3+
void main()
4+
{
5+
int n,i,z,temp=0,j=0,count=0;
6+
char a[50],l[50];
7+
printf("Enter the string");
8+
gets(a);
9+
z=strlen(a);
10+
for(i=0;i<z;i++)
11+
{
12+
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u'||a[i]=='A'||a[i]=='E'||a[i]=='I'||a[i]=='O'||a[i]=='U')
13+
{
14+
l[j]=i;
15+
j++;
16+
}
17+
}
18+
19+
for(i=0;i<j-1;i++)
20+
{
21+
temp=l[i+1]-l[i];
22+
if(temp==1)
23+
{
24+
count++;
25+
}
26+
}
27+
printf("The Number of consecutive vowels are = %d",count);
28+
}

0 commit comments

Comments
 (0)