Consider the following code segment:

int p = 5;
while(p > 0)
{
for(int j = p; j < p*2; j++)
{
System.out.print(" * ");
}
System.out.println();
p--;
}
What will the final result be when run in the console?

* * * * *
* * * *
* * *
* *
*

* * * * * *
* * * * *
* * * *
* * *
* *

*
* *
* * *
* * * *
* * * * *

* * * * * * * * * * * * * * * *
* * * * * * * * * * * * *
* * * * * * * * * *
* * * * * * *
* * * *

* *
* * *
* * * *
* * * * *

Respuesta :

Answer:

ok so the severs are being dumb but the answer is 1

Explanation:

fichoh

Evaluating the Java program, the output of the code block would be the option A.

  • The loop run while the value of p is greater than 0. With p having an initial value of 5.

  • j loops from the current value of p, till 2*p - 1; with the value of p decreasing by 1 after each iteration.

When p = 5

j = 5 till < (2 × 5) = 10

j = 5 till 9 ; Hence, 5 *'s will be printed followed by a newline.

With the value of p changing to p - 1 = 4 and so on.

Hence, we'll have 5*'s then 4*'s,.. 1*

Learn more :https://brainly.com/question/22685274