Code:
class Vowel_ASCII
{
public static void main(String args[])
{
String st="THIS IS IT";
int i,l,c,count=0;
l=st.length();
for(i=0;i<l;i++)
{
c=st.charAt(i);
if(c==65 || c==69 || c==73 || c==79 || c==85 ||
c==97 || c==101 || c==105 || c==111 || c==117)
count++;
}
System.out.println(count);
}
}
class Vowel_ASCII
{
public static void main(String args[])
{
String st="THIS IS IT";
int i,l,c,count=0;
l=st.length();
for(i=0;i<l;i++)
{
c=st.charAt(i);
if(c==65 || c==69 || c==73 || c==79 || c==85 ||
c==97 || c==101 || c==105 || c==111 || c==117)
count++;
}
System.out.println(count);
}
}
No comments:
Post a Comment