Once you attempt the question then PrepInsta explanation will be displayed.
In the given code :
num is set to 4:
Now, the outer for loop will execute, as the condition i>0 i.e, 4>0 //True
The inner for loop will execute 3 times, and print * on the screen,
After that num will decrement by 1 and become 3 and the cursor moves to the next line.
Again, the outer for loop will execute, as the condition i>0 i.e, 3>0 //True
The inner for loop will execute 2 times, and print * on the screen,
After that num will decrement by 1 and become 2 and the cursor moves to the next line.
Again, the outer for loop will execute, as the condition i>0 i.e, 2>0 //True
The inner for loop will execute 1 times, and print * on the screen,
After that num will decrement by 1 and become 1 and the cursor moves to the next line.
Again, the outer for loop will execute, as the condition i>0 i.e, 1>0 //True
The inner for loop will execute 0 times, and will not print * on the screen,
After that num will decrement by 1 and become 0 and the cursor moves to the next line.
Now, the condition of the outer loop will become false. And get terminated.