5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
write a java program to display this pattern
Answers
Answered by
1
Answer:Source Code
public class Pattern {
public static void main(String[] args) {
char last = 'E', alphabet = 'A';
for(int i = 1; i <= (last-'A'+1); ++i) {
for(int j = 1; j <= i; ++j) {
System.out.print(alphabet + " ");
}
++alphabet;
System.out.println();
}
}
}
Explanation:
Similar questions