Computer Science, asked by pvn210803, 6 months ago

nomben in Binin
Problem 3 - show the 9325.768 decomal
BCD
and Gxcess - 3 Codes'​

Answers

Answered by r30499699
0

import java.io.*;

import java.util.*;

public class Program {

public static void main(String []args) {

Scanner in = new Scanner(System.in);

System.out.print("Enter a number: ");

int n=in.nextInt();

for(int i=1;i<=n;i++) {

for(int j=i;j<=n-1;j++) {

System.out.print(" ");

}

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

System.out.print(j);

}

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

System.out.print(j);

}

System.out.println();

}

}

}

Output:

$ java Program

Enter a number: 4

1

121

12321

1234321

Similar questions