Computer Science, asked by Hitakshi11, 11 months ago

plz solve the following java pattern using nested loop​

Attachments:

Answers

Answered by nishiwaghmare0995
1

Answer:

public class MyClass {

   public static void main(String args[]) {

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

     {

         if(i%2!=0)

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

         {

             if(j%2!=0)

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

         }

         System.out.print("\n");  

     }

   }

}

output :

1

3 1

5 3 1

7 5 3 1

9 7 5 3 1

Explanation:

Similar questions