Computer Science, asked by sakshamrai8, 10 months ago

WAP in Java to display the pattern
both
I make brainlist

Attachments:

Answers

Answered by mn121
11

5.

public class p5

{

public static void main(String args[])

{

int i,j,sp=4;

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

{

for(j=1;j<=sp;j++)

System.out.print(" ");

sp--;

for(j=i;j>=1;j--)

System.out.print(j);

System.out.println();

}

}

}

6.

public class p6

{

public static void main(String args[])

{

int i,j;

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

{

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

System.out.print(j);

System.out.println();

}

}

}

please mark it as brainliest...

^_^

Similar questions