Question: Please Correct my code. My code doesn't print the following output. Code should be in Java. Output: E E D E D C E D

Please Correct my code. My code doesn't print the following output. Code should be in Java.

Output:

E

E D

E D C

E D C B

E D C B A

My Code:

public class Main { public final static int SIZE=5; public static void main(String[] args) { char alph; for(int i=1; i<=SIZE; i++) { alph='E'; for(int j=1; j<=i; j++) { System.out.printf("%c ",alph--); } System.out.printf(" "); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!