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
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!
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
8
Answer:
given below is the answer
Explanation:
plzz mark me as the brainlist
Attachments:
Similar questions
Psychology,
7 months ago
Hindi,
7 months ago
Math,
7 months ago
Geography,
1 year ago
Economy,
1 year ago
Biology,
1 year ago
Social Sciences,
1 year ago
History,
1 year ago