Business

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

Show More

J. Satya

Started blogging in 2010 but working professionally from 2012. Apart from that working as a Digital Marketer, SEO & Conversion Specialist. Helping individuals as well as business to grow.

Related Articles

Leave a Reply

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

Back to top button
Close
Close