Write M file with while loop, which computes factorial of any x, (x=12).
386 views (last 30 days)
Define x=12, Start with some value of factorial say Fact=1; - while loop condition will be x > 1 - compute factorial by multiplying the number with Fact - Reduce number by 1 - Close the while loop - Display the Fact
This is what I have so far (it is incorrect):
fact = x*(x-1);