Solved

What Will Be the Output of the Following Code Snippet

Question 52

Multiple Choice

What will be the output of the following code snippet?
Int i;
Int j;
For (i = 0; i < 7; i++)
{
For (j = 7; j > i; j--)
{
System.out.print("*") ;
}
System.out.println("") ;
}


A) A rectangle with six rows and seven columns of asterisks. The number of rows increments by one on completion of one iteration of the inner loop.
B) A right triangle with six rows and seven columns of asterisks. The number of columns increments by one on completion of one iteration of the inner loop.
C) A rectangle with seven rows and six columns of asterisks. The number of rows increments by one on completion of one iteration of the inner loop.
D) A right triangle with six rows and seven columns of asterisks. The number of columns decrements by one on completion of one iteration of the inner loop.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions