|
Get 9,000+ Interview Questions with Answers in an eBook
C Source Codes List | Source Code Home
Program : Program to display all vowels in a i/p line of text.
/* Prg. to display all vowels in a i/p line of text */
#include
#include
void main()
{
char line[80],c;
int i;
clrscr();
printf("\nEnter string:-");
printf("\nString will be terminated if you press ENTER");
printf("\nSTRING:-");
gets(line);
for (i=0;(i<=80 && line[i]!='\0');i++)
{
if (line[i]=='a'||line[i]=='A'||line[i]=='e'||line[i]=='E'
||line[i]=='i' ||line[i]=='I'||line[i]=='o'||line[i]=='O'
||line[i]=='u'||line[i]=='U')
{
printf("%c",line[i]);
printf(" ");
}
}
getch();
}
C Source Codes List | Source Code Home
|
|
|