Search

Google
 

Monday, February 4, 2008

ICSE JAVA String Program

write a program to accept a string and display the new string after removing all the vowels from the string
eg
input:Computer Applications with BlueJ
output:Cmptr pplctns wth BlJ



class test
{
void main(String a)
{
char d;for(int c=0;c < a.length();c++)
{
d=a.charAt(c);
if(d!='a' && d!='A' && d!='e' && d!='E' && d!='i' && d!='I' && d!='o' && d!='O' && d!='u' && d!='U')System.out.print(d);
}
}
}

From :http://icse.fairtopic.com

No comments: