import java.io.*;
class CountVowels
{
public static void main(String args[])
{
String s1="0";
int count=0;
char x;
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the alphabets of string");
try
{
s1=bf.readLine();
}
catch(Exception e)
{
e.printStackTrace();
}
for(int i=0;i<s1.length();i++)
{
x=s1.charAt(i);
if(x=='a'||x=='e'||x=='i'||x=='o'||x=='u')
{
count++;
}
}
System.out.println("the number of vowels in string are:"+count);
}
}
class CountVowels
{
public static void main(String args[])
{
String s1="0";
int count=0;
char x;
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter the alphabets of string");
try
{
s1=bf.readLine();
}
catch(Exception e)
{
e.printStackTrace();
}
for(int i=0;i<s1.length();i++)
{
x=s1.charAt(i);
if(x=='a'||x=='e'||x=='i'||x=='o'||x=='u')
{
count++;
}
}
System.out.println("the number of vowels in string are:"+count);
}
}
Comments
Post a Comment