Computer Science, asked by hitam, 1 year ago

Write a program in Java to accept a sentence and display the new string after removing all the vowels present in it
Sample Input: COMPUTER APPLICATIONS
Sample Output: CMPTR PPLCTNS
pls guys i hv my exam plsssssssssssssssssssssss using scanner class

Answers

Answered by crashdhabalp6txxb
40
import Java.util.Scanner;
class prog
{
public static void main(String args[])
{
Scanner sc =new Scanner(System.in);
System.out.println("enter sentence");
String a=sc.nextLine();
String b="";
int len=a.lenghth();
for(int i=0;i<len;i++)
{
char c=a.charAt(i);
if((c=='a')||(c=='e')||(c=='i')||(c=='o')||(c=='u'))
continue;
else if((c=='A')||(c=='E')||(c=='I')||(c=='O')||(c=='U'))
continue;
else
b=b+c;

}
System.out.println(b);


}
}


Hope you like the answer!
Answered by pritimayeepradhan678
8

Answer:

given below is the answer

Explanation:

plzz mark me as the brainlist

Attachments:
Similar questions