Solved

What Will Be the Output of the Following Code Snippet

Question 118

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents