Computer Science, asked by himanshi1236, 3 months ago

1
3 1
5 3 1
7 5 3 1
9 7 5 3 3 1
Write the program to display the following pattern

Answers

Answered by imtiyazallam
0

Answer:

Answer in the attachment.

output:

1

3 1

5 3 1

7 5 3 1

9 7 5 3 1

Attachments:
Answered by ravi2303kumar
0

Output:

1

3 1

5 3 1

7 5 3 1

9 7 5 3 3 1

Program (java) :

public class Main

{

public static void main(String[] args) {

    for(int i=0;i<=4;i++){

        for(int j=(2*i)+1;j>=1;j=j-2){

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

        }

        System.out.println();

    }  

}

}

Similar questions