-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
50 lines (50 loc) · 975 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.util.*;
class Main
{
public static void main(String args[])
{
Scanner cin=new Scanner(System.in);
System.out.println("plzz Enter Integer Type Number :- ");
int N=cin.nextInt();
int n=N;
for(int i=1;i<=N;i++)
{ char ch='A';
for(int j=i;j<=N;j++)
{
System.out.print(ch);
ch++;
}
for (int k=1; k<i;k++)
{
System.out.print(" ");
}
ch--;
for(int j=N;j>=i;j--)
{
System.out.print(ch);
ch--;
}
System.out.println("");
}
for(int i=N;i>=1;i--)
{
char ch='A';
for(int j=i;j<=N;j++)
{
System.out.print(ch);
ch++;
}
for(int k=i;k>1;k--)
{
System.out.print(" ");
}
ch--;
for(int j=N;j>=i;j--)
{
System.out.print(ch);
ch--;
}
System.out.println("");
}
}
}