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:
Verified
Q113: A loop inside another loop is called:
A)
Q114: What will be the range of the
Q115: In the following code snippet, when does
Q116: Which for loop prints data across each
Q117: How many times will the output line
Q119: What is the last output line of
Q120: What is the output of this code
Q121: Suppose that the chance to hit the
Q122: What does the following code snippet display?
Q123: Which of the following is the correct
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents