Question: What does the following Java code display on the screen? int rows = 4 ; String output = ; for ( int i

What does the following Java code display on the screen?
int rows =4;
String output ="";
for (int i =0; i < rows; i++)
{
output = output + i;
for (int j =0; j < i; j++)
output = output +"*";
}
System.out.print(output);
Question 9 Answer
a.
0*1*2*3*
b.
01*2**3***
c.
01*2**3***4****
d.
0***1***2***3***
e.
None of the above

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 Programming Questions!