Computer Science, asked by dibashparui2020, 6 days ago

Can someone provide me the dry run of this program in JAVA?
The program:
public class{
static void main(String args[]){
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
if(j%2==0)
System.out.print("#\t");

else
System.out.print("*\t");
}
System.out.println();
}
}

The output is:
*
* #
* # *
* # * #
* # * # *

Answers

Answered by prabinkumarbehera
0

Answer:

Can someone provide me the dry run of this program in JAVA?

The program:

public class{

static void main(String args[]){

{

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

{

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

{

if(j%2==0)

System.out.print("#\t");

else

System.out.print("*\t");

}

System.out.println();

}

}

The output is:

*

* #

* # *

* # * #

* # * # *

Similar questions