C Program | Count Vowels in a String
Write a Code On C Program , Count Vowels in a String , User Define:
Code:
#include<stdio.h>
#include<string.h>
void main()
{
int i,c=0,l;
char s[20];
printf("Enter the string:\n");
gets(s);
l=strlen(s);
for(i=0;i<l;i++)
{
if(s[i]=='a' || s[i]=='e' || s[i]=='i'||s[i]=='o' || s[i]=='u' || s[i]=='A' || s[i]=='E'|| s[i]=='I' || s[i]=='O' || s[i]=='U')
c++;
}
printf("The Vowels in string is: %d\n",c);
}
Comments
Post a Comment
Give your feedback!
DO NOT SPAM !!
NO THIRD PARTY PROMOTIONAL LINK !!!! (else comment will be deleted.)