Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started