Computer Science, asked by rimmi28, 4 months ago

print the following pattern in java

9 7 5 3 1
7 5 3 1
5 3 1
3 1
1​

Answers

Answered by Anonymous
3

Answer:

The following are the physical properties of metal :

  1. The physical properties make them useful for many purposes. For e.g. Copper is used in making electric wires, gold is used to make jewellery, stainless steel is used to make pots, pans, etc
  2. Metals react with nonmetals to form ionic bonds. For e.g. Sodium Chloride (NaCl)
  3. Metals are a good conductor of electricity which means that they can conduct electricity due to the free moving electrons present in them. Copper is used as wiring as it is a good conductor of electricity.
  4. Metals have high melting points and high boiling points as they have strong metallic bonds.
  5. All metals are physically lustrous. They have a lustre that makes them shine. Gold is used for making jewellery.
  6. Metals are hard, they can’t be broken easily and require a lot of energy and strength to break. Iron is used to make cars, buildings, ships, etc.
  7. Metals weigh a lot as they have a high density. Metals are heavy for their size.
  8. They don’t have flexibility and have tensile strength. Metals can’t be stretched.

I hope this will be help you.

Answered by anindyaadhikari13
1

Required Answer:-

Question:

Write a Java program to display the pattern.

9 7 5 3 1

7 5 3 1

5 3 1

3 1

1

Solution:

Here is the answer.

  1. public class Pattern {
  2. public static void main(String[] args) {
  3. for(int i=9;i>=1;i-=2)
  4. {
  5. for(int j=i;j>=1;j-=2)
  6. System.out.print(j+" ");
  7. System.out.println();
  8. }
  9. }
  10. }

Explanation:

  • Outer loop runs for i = 9 to 1 (step 2). Inner loop runs for j = i to 1(step 2) For the first iteration of outer loop, the inner loop run for j = 9 to 1, So 9 7 5 3 1 is displayed. For the second iteration of outer loop, the inner loop run for j = 7 to 1, So 7 5 3 1 is displayed and so on.

Output is attached.

Attachments:
Similar questions