Follow the algorithm below and show the result given below,
Step 1: get a value for N
Step 2: set the value of VAR to 1
Step 3: while N => 0 do set the value of VAR to VAR* set the value of N to N -1
Step 4: end of the loop
Step 5: return the value of VAR
If N = 5 then print the value of VAR at the end.
Answers
Explanation:
below,
Step 1: get a value for N
Step 2: set the value of VAR to 1
Step 3: while N => 0 do set the value of VAR to VAR* set the value of N to N -1
Step 4: end of the loop
Step 5: return the value of VAR
If N = 5 then print the value of VAR at the end.
(1)
In the equation, N represents a specific number, not any number.
N + 9 = 12 means N is a number which, when added to 9, must give the answer 12. So N can only be the number 3 because only 3 + 9 is equal to 12.
(2)
So result = 0 because any number + 0 results that number. It is setting the initial value of the variable result to 1. If you delete it, you are multiplying a base by nothing and if set to 0, you are multiplying it by 0. This is a function to calculate the power of the number.
(3)
(let i = 0; i < 3; i++) {
funcs[i] = function() {
console.log("My value: " + i);
};
}
(4)
Endloop. Description. The form's end loop statement terminates the loops defined by the begin/end program blocks associated with several of the statements of the form, such as unload table, form data, or table data. If loops are nested, and the loop terminates only the loop in which it is executed; no outer loops are terminated.
(5)
Input: N = 10
Output: 10 9 8 7 6 5 4 3 2 1
Input: N = 7
Output: 7 6 5 4 3 2 1
#SPJ2