Draw a flowchart and write an algorithm in QBASIC to find the factorial of a number.
Answers
Answered by
0
Answer:
Algorithm
Start
Declare the variable number
Declare the variable factorial =1
If number < 0 Then
Display the message: "Factorial of negative number is not possible"
ElseIf number = 0 Or number = 1 Then
factorial=1
Display the factorial
Else
Calculate the factorial using for loop
For i = 1 To number
factorial = factorial * i
Display the factorial
End If
Explanation:
i hope it's helpful
Similar questions