Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.17 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. echo "Enter the number to calculate the factorial"
  2. read num
  3. c=$num
  4. fact=$num
  5. for (( c = num; c = 0 ; c-- ))
  6. do
  7.   fact = `expr $fact \* ($num-1)`
  8.   echo fact
  9. done