import java.util.*;
public class STRING
{
public static void main(String args[])
{
Scanner in=new Scanner (System.in);
String s="",s1; int Length,i,vowel=0,constant=0;
char ch;
s1=s.toLowerCase();
System.out.println("Enter a Word");
s=in.nextLine();
Length=s.length();
for(i=0;i<Length;i++)
{
ch=s.charAt(i);
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
vowel++;
else
constant++;
}
System.out.println("The Number of Vowels in "+s+" is "+vowel);
System.out.println("The Number of Constants in "+s+" is "+constant);
}
}
No comments:
Post a Comment