hi I am new to programming, I will like to know if my code are ok:
CALCULATE THE FACTORIAL OF A NUMBER PROVIDED BY THE USER.
- Data Counter as a Wholenumber
- Data Number as a Wholenumber
Data Factorial as a Wholenumber
Output “Enter Number”
Input Number
Counter =Number
Factorial=Number;
Loop until counter is equal to 1
Counter= Counter-1
- Factorial= Factorial * Counter
- Next Loop
- Output Factorial
LINE Number Factorial Counter Notes
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0 Output
5 5 0 0 User Enters 5
6 5 0 5
7 5 5 5
8 5 5 5 Loop until counter is equal to 1
9 5 5 4
10 5 20 4
11 5 20 4 Back to Line 8
8 5 20 4
9 5 20 3
10 5 60 3
11 5 60 3 Back to Line 8
8 5 60 3
9 5 60 2
10 5 120 2
11 5 120 2 Back to Line 8
8 5 120 2
9 5 120 1
12 5 120 1 Output