+1 vote
in JAVA by
Write a program in java to remove all vowels from a string.

2 Answers

0 votes
by
Write a program in java to remove all vowels from a string.

import java.util.Scanner;

public class star {

     public static void main(String[] args) {

         Scanner sc=new Scanner(System.in);

         String n=sc.nextLine();

         String n1=n.replaceAll("[AEIOUaeiou]", "");

         System.out.println(n1);

         }

        }
0 votes
by
Write a program to generate the following output.

****

***

**

*

public class star {

     public static void main(String[] args) {

         int i;

         int count=1;

        for (i=5;i>=1;i--){

            for (int j=1;j<=i;j++)

                System.out.print("*");

            System.out.println(" ");

        }

}

}

Related questions

+3 votes
asked May 12, 2021 in JAVA by rajeshsharma
+1 vote
asked May 7, 2021 in JAVA by sharadyadav1986
...