Write a program to accept a string. Count all the letters excluding vowels present in string.
Answers
Answered by
3
class sample
{
public void show(String a)
{
int l = a.length,i,c=0;
for(i=0;i<l;i++)
{
if(l(i)!='a' && l(i)!='e' && l(i)!='i' && l(i)!='o' && l(i)=='u')
c++;
else
c=c;
}
System.out.println("number of letters in string excluding vowels is" + c);
}
}
{
public void show(String a)
{
int l = a.length,i,c=0;
for(i=0;i<l;i++)
{
if(l(i)!='a' && l(i)!='e' && l(i)!='i' && l(i)!='o' && l(i)=='u')
c++;
else
c=c;
}
System.out.println("number of letters in string excluding vowels is" + c);
}
}
Similar questions