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);
}

Output:

 --------------------------

C Program: Convert  lower case to upper case

Comments

Popular posts from this blog

TOP 10 PROGRAMMING LANGAUAGES COMMING 2021 | ARTICLE

Write a C-program to swap two number:

Print Fibonacci Series using Recursion | C program :