Program to accept a string and display vowels (DOC) by kundalokesh

VIEWS: 45 PAGES: 1

									#include<stdio.h>
#include<conio.h>
#include<string.h>
char vowels(char *p);
void main()
{
char str[10];
clrscr();
printf("\n\nEnter the string\t");
gets(str);
vowels(str);
getch();
}
char vowels(char *p)
{
int i,l;
l=strlen(p);
printf("\n\nThe vowels in the string are\t");
for(i=0;i<l;i++)
{
if(p[i]=='a' || p[i]== 'e' || p[i]=='i' || p[i]=='o' || p[i]=='u'||
p[i]=='A' || p[i]=='E' || p[i]=='I' || p[i]=='O' || p[i]=='U')
{
printf("%c",p[i]);
}
else
continue;
}
return 1;
}

}

								
To top