Which part of this is a non-negative integer? (factorial error) [closed]

In the line for col=1:1:n, col can get up to the value n, even when row is still 1. Therefore when you call factorial(row-col), row can be 1 and col can be 2. This is where it can be negative.

Leave a Comment