nawk ' BEGIN { printf("Enter number: ") } $1 ~ /[0-9]+/ { number = $1 fact = number for (x = number - 1 ; x > 1; x--) fact *= x printf("The factorial of %d is %g\n", number, fact) exit } $1 !~ /[0-9]+/ { printf("\nInvalid entry. Enter a number: ") }' - # # A repetitive (not recursive) computation of factotials #