The function below takes one parameter: an integer (begin). Complete the function so that it prints the numbers starting at begi
n down to 1, each on a separate line. There are two recommended approaches for this: (1) use a for loop over a range statement with a negative step value, or (2) use a while loop, printing and decrementing the value each time.
Start for loop by assigning the loop variable to parameter value and condition will be that loop variable will be greater then 0 and at the end decrements the loop variable.
2) By usin WhileLoop
void whileLoopFunction(int value){
while(value>0){
cout<<value<<endl;
value--;
}
}
Explanation
In while loop first add the condition as variable must be greater then 0 and then print the value with endl sign to send the cursor to next line and at the end of the loop decrements the variable.