Social Icons

Wednesday 1 May 2013

Factorial Of a No. Using Shell Program



#!/bin/sh
fact=1;
echo -n "Enter any no to find factorial :  "
read  n
for((i=1;i<=n;i++))
do
((fact=$fact * $i))

done

echo " .............factorial of the no. is : ........   : $fact"
exit 0


No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management