by Dinesh Thakur

Algorithm for Remove Vowels from a Sentence:

step 1: read String word

step 2: set char array c[]=word. to CharArray()

step 3: create new char array cc[] of size 80

step 4: setj=0

step 5: initialize i=0

step 6: repeat through step-8 while(i<c.length)

step 7: if(c[i]=='a'llc[i]=='e'llc[i]=='i'llc[i]=='o'llc[i]=='u')

then goto step-6

else cc[j]=c[i] , j=j+ 1

step 8: i=i+ 1

step 9: print c

step 10: print cc

step 11: Exit

Here is the Java Example for Remove Vowels from a Sentence:

import java.util.*;

class RemoveVowels
{
                    public static void main(String args[])
           {
                            System.out.print("Please Enter the Sentence : ");
                            Scanner s=new Scanner(System.in);
                            String word=s.nextLine();
                            char[] c=word.toCharArray();
                            char cc[]=new char[80];
                            int j=0;
                            for(int i=0;i<c.length;i++)
                                {
                                    if(c[i]== 'a' || c[i]== 'e' || c[i]=='i' || c[i]== '0' || c[i]== 'u')
                                      {
                                          continue;
                                      }
                                    else
                                      {
                                        cc[j]=c[i];
                                         j++;
                                       }
                                 }
                                       System.out.print("After Removeing Vowels from a Sentence : ");
                                       System.out.print(cc);
               }
}

Remove Vowels from a Sentence