Skip to content

Commit

Permalink
Merge pull request vglug#1 from dilip0207/dilip0207-patch-1
Browse files Browse the repository at this point in the history
vowels_palindrome_in_a_string
  • Loading branch information
dilip-hari authored Oct 30, 2021
2 parents d4de613 + 711eb09 commit 32fa08f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions c/vowels_palindrome_in_a_string
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include<stdio.h>
#include<string.h>
int findlength(char s[])
{
int i,count=0;
for(i=0;s[i]!='\0';i++)
{
count++;
}
return count;
}
void main()
{
int i,n,j;
char s[30];
gets(s);
n=findlength(s);
char vowel[10];
j=0;
for(i=0;i<n;i++)
{
if(s[i]=='a' || s[i]=='e' || s[i]=='i' || s[i]=='o' || s[i]=='u')
{
vowel[j]=s[i];
j++;
}
}
vowel[j]='\0';
for(i=0;i<j/2;i++)
{
if(vowel[i]!=vowel[j-1-i])
break;
}
if(i==j/2)
{
printf("yes");
}
}

0 comments on commit 32fa08f

Please sign in to comment.