please i need help in
1. writing an algorithm to find the factorial of 10
2. enumerate the operators and operation to represent the following
i. comparism
ii. ordering
iii. assignment
iv. arithmetic
thanks
int main()
{
std::cout << "This is a an algorithm to find the factorial of 10" << std::endl;
int Value = 10;
std::cout << iValue << "! = " << Ffactorial(iValue)<< std::endl;
return 0;
}
int Ffactorial(int iValue){
if (iValue > 1){
return (iValue * Ffactorial(iValue - 1));}
else {return 1;}
}
+++++++++++++++++++++++++++++++++++
i. We used ">" to compare the value of iValue with 1.
ii. The way the algorithm was implemented has not allowed for illustrating the ordering. But generally, ordering of operation/operator follows the BODMAS (Bracket of Division, Multiplication, Addition and Subtraction) rule .
iii. The "iValue = 10". Here we assigned the value 10 to the iValue variable using the = (assignment operator).
v. The * is used to carry out the multiplication operation.