Write a program in java to display the given pattern.
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Please answer it correctly
I will mark you as brainlist
Please answer it very fast
Answers
Answered by
0
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();
}
}
}
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();
}
}
}
shalini683:
where is full program
Answered by
0
hope it helps u
mark it BRAINLIEST
Attachments:
Similar questions