What will be the output of the following code snippet?
Int i;
Int j;
For (i = 0; i < 6; 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) An inverted 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
Q21: What is the output of the code
Q28: Select the statement that correctly completes the
Q45: Which statement about this code snippet is
Q62: Which of the following statements is correct
Q88: What will be the output of the
Q89: Is the code snippet written below legal?
String
Q91: How many times does the following loop
Q95: What is the last output line of
Q98: What is the output of this code
Q98: When will the loop in the following
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