We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05ccd24 commit 7674d49Copy full SHA for 7674d49
factorial.sh
@@ -0,0 +1,8 @@
1
+#!/bin/bash
2
+read -p "Enter Number: "$'\n' number
3
+fact=1
4
+for (( i=1; i<=number; i++ ))
5
+do
6
+fact=$(($fact*$i))
7
+done
8
+echo "Factorial of $number is: $fact"
fibonacci.sh
@@ -0,0 +1,13 @@
+!#/bin/bash
+read -p "Enter Limit: " limit
+t1=0
+t2=1
+echo -n $t1 $'\t' $t2
+for((i=3; i<=limit; i++))
+sum=$((t1+$t2))
9
+echo -n $'\t' $sum
10
+t1=$t2
11
+t2=$sum
12
13
+echo $'\n'
star_patter.sh
@@ -0,0 +1,11 @@
+for((i=0; i<=limit; i++))
+for((j=0; j<=i; j++))
+echo -n " * "
+
0 commit comments