PROGRAM TO COUNT NUMBER OF VOWELS IN A GIVEN ARRAY

/*PROGRAM TO COUNT NUMBER OF VOWELS IN A GIVEN ARRAY*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,count=0;
char a[10];
clrscr();
printf(“Enter any ten alphabets in the array:\n”);
for(i=0;i<10;i++)
scanf(“\n%c”,&a[i]);
printf(“Vowels present in the array are:\n”);
for(i=0;i<10;i++)
{
if(a[i]==’a’||a[i]==’e’||a[i]==’i’||a[i]==’o’|| a[i]==’u’)
{
printf(“%c\t”,a[i]);
count=count+1;
}
}
printf(“\nNumber of vowels present in the array are: %d”,count);
getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *