C Program to Input String and Count Vowel from the String

Write a C program to input a string and count the no of vowels in the string. Write a program to input string and count the vowel from the entered string. C Program to Input String and Count Vowel from the String

Write a C program to input a string and count the no of vowels in the string.
Write a program to input string and count the vowel from the entered string. 
C Program to Input String and Count Vowel from the String

Source Code
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
 char string[25];
 int count=0,i,length;
 clrscr();
 printf("Enter the string:");
 scanf("%s",string);
 length=strlen(string);
 for(i=0;i<length;i++)
 {
  if(string[i]=='a'||string[i]=='e'||string[i]=='i'||string[i]=='o'||string[i]=='u')
   count=count+1;
 }
 printf("No of vowels=%d",count);
        getch();
}

You May Also Like...

Socialize with Us