Computer Science, asked by padmavilluri789, 11 months ago

a)Write a program to display the following pattern in java:
1
3 1
5 3 1
7 5 3 1
9 7 5 3 1
Answer it correctly.....if u dont know the answer.....dont answer.

Answers

Answered by Anonymous
2

Question:

a)Write a program to display the following pattern in java:

1

3 1

5 3 1

7 5 3 1

9 7 5 3 1

Answer:

import java.util.*;

public class Pattern

{

public static void main(String args[])

{

Scanner in =new Sacanner(Syste.in);

int a,b,c,d;

System.out.println("The pattern");

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

{

c=d

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

System.out.println(c+" ");

c=c-2;

}

d=d-2;

System.out.println( );

}

}

}

For more java programmings follow the given links as I have solved earlier:

https://brainly.in/question/14797688

brainly.in/question/16088835

brainly.in/question/16091640

Similar questions