Computer Science, asked by shashikaruneshverma, 10 months ago

write a program in java in blue j using for loop

Attachments:

Answers

Answered by pavithranatarajan855
1

Answer:

public class Main {

 public static void main(String args[]){

   int i,j;

   for(i=1;i<=5;i++)

   {

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

       if(i%2!=0)

       System.out.print("# ");

       else

       System.out.print("* ");

     }

     System.out.println();

   }

 }

}

 

Explanation:

If i is odd then print # j times if i is even then print * j times.

Please Mark me as Brainliest

Similar questions