Posts

Factorial

  read -p "Enter the number : " number  fact=1 while [ Snumber -gt 1]  do fact=$((fact * number)) #fact = fact * num number=$((number - 1)) #num = num - 1 done echo "Result:" $fact

Fibonaki

  read -p "Enter the Number: " number  x=0 y=1 i=2 echo "Fibonacci Series Upto $number Number: "  echo "$x"  echo "$y" while [ $i -It $number ]  do i='expr $i + 1'  z='expr $x+ $y' echo "$z" X=$y y=$z done