Write a shell script to find the exponent of a number?



echo  “ enter 2 numbers”
read a
read b
ex = 1
i = 1
while [ $i – li $h ]
do
ex = `expr $ex \* $a `
i= `expr $i + 1`
done
echo “ $i exponent $b is $ex ”




OUTPUT:
Enter 2 numbers
5
2

5 exponent 2 is 25

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart