Computer Science, asked by AnoushkaPaul, 2 months ago

plz answer thissssss​

Attachments:

Answers

Answered by kamalrajatjoshi94
2

Answer:

Program 1:

public class Pattern

{

public static void main(String args[ ])

{

int a,b;

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

{

for(b=1;b<=a;b++)

{

System.out.print(" * "+" ");

}

System.out.println();

}

}

}

Program 2:

public class Pattern2

{

public static void main(String args[ ])

{

int a,b;

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

{

for(b=1;b<=a;b++)

{

System.out.print(b+" ");

}

System.out.println();

}

}

}

Similar questions