092. Write a program to count all vowels present in the string in C language

#include<stdio.h>
#include<conio.h>
main()
{
	int i,vowel=0;
	char *s;
	clrscr();
	printf("Enter the string 1....");
	scanf("%s",s);
 
	for(i=0;s[i]!='\0';i++)
	{
		if((s[i]=='A')||(s[i]=='E')||(s[i]=='O')||(s[i]=='U')||(s[i]=='I')||
		  (s[i]=='a')||(s[i]=='e')||(s[i]=='o')||(s[i]=='u')||(s[i]=='i'))
						vowel++;
	}
	printf("\nVowels : %d",vowel);
	getch();
}

Leave a Reply

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