Answer:
The code to this question can be given as:
Code:
int n=5; //define an integer variable n and assign a positive value.
while(n > 0) //define while loop,
{
printf("*"); //print asterisks.
n --; //decrements value.
}
Explanation:
The description of the above code can be given as:
- In this code we define an integer variable that is "n" and assign a positive value that is "6".
- Then we define a while loop. It is an entry control loop which means it will check condition first then executes. In this loop, we use variable n and check condition that the value of n is greater than 0.
- In this loop, we print the asterisks and decrease the value of n. When the variable n value is 0. It will terminate the loop and print asterisks.