Computer Science, asked by niharikav633, 10 months ago

write a program to obtain the following output:
a *
**
***
b. *
***
*****
c. 1
222
33333​

Answers

Answered by rakeshchennupati143
1

Program :

A:

import java.io.*;

public class Main{

     public static void main(String args[]){

           int i,j;

           for (int i = 1; i < 4; i ++){

                 for ( int j = 0 ; j < i ; j ++){

                       System.out.println("*");

                 }

                 System.out.print("\n");

           }

     }

}

B:

import java.io.*;

public class Main{

     public static void main(String args[]){

           int i,j;

           for ( i = 1; i < 6; i ++){

                 for ( j = 0 ; j < i ; j ++){

                       System.out.println("*");

                 }

                 System.out.print("\n");

                 i++;

           }

     }

}

C:

import java.io.*;

public class Main{

     public static void main(String args[]){

           int i,j,z=1;

           for ( i = 1; i < 6; i ++){

                 for ( j = 0 ; j < i ; j ++){

                       System.out.println(z);

                 }

                 z++;

                 System.out.print("\n");

                 i++;

           }

     }

}

----Hope you got what you wanted ( mark brainliest if you like my answer  :) )

Similar questions