Sunday, 24 January 2021

to print the world with no vovel

import java.io.*;
class vovel
{
    public static void main(String args[])throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        System.out.println("entre the  sentences");
        String s2=br.readLine();
        String s1="";
        s2=s2+"  ";
        int l=s2.length();
        
        
        int l2=0;boolean found=false;;
        for(int i=0;i<l;i++)
        {
               if(s2.charAt(i)==' ')
                {
                   for(int j=l2;j<=i;j++)
                   {
                    if(s2.charAt(j)=='a'||s2.charAt(j)=='e'||s2.charAt(j)=='i'||s2.charAt(j)=='o'||s2.charAt(j)=='u')
                    {
                        found=true;
                        break;
                    }
                }
                    
                    if(found==false)
                     {
                       for(int k=l2;k<=i;k++)
                       {
                           s1=s1+s2.charAt(k);
                        }
                      
                    }
                    System.out.println(s1);
                     s1="";
                    found=false;
                    l2=i+1;
                    
                }
                    
            }
                
            }
        }

No comments:

Post a Comment

HAY THAKYOU FOE VISIT

Program(python):-Find duplicates in an array (Geeks for geek problem)

QUESTION:- Given an array  a  of size  N  which contains elements from  0  to  N-1 , you need to find all the elements occurring more than o...