Cognizant Coding Question- 5

One comment on “Cognizant Coding Question- 5”


  • Aqib

    import java.util.*;
    public class RemoveVowel {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    String s1=sc.nextLine();
    String s2=””;
    for(int i=0;i<s1.length();i++)
    {
    if(!(s1.charAt(i)=='a'||s1.charAt(i)=='e'||s1.charAt(i)=='i'||s1.charAt(i)=='o'||
    s1.charAt(i)=='u'||s1.charAt(i)=='A'||s1.charAt(i)=='E'||s1.charAt(i)=='I'||
    s1.charAt(i)=='O'||s1.charAt(i)=='U'))
    {
    s2=s2+s1.charAt(i);
    }
    }
    System.out.println(s2);

    }
    }
    This is Simple Solution