SHELL PROGRAM
Program to find the power of a number ? | Shell Program |
#!/bin/bash
echo "Enter the number:"
read num
echo "Enter the power:"
read pow
rs=$(echo "$num ^ $pow"|bc)
echo "$num raised to the power $pow is:$rs"
OUTPUT
Enter the number:
5
Enter the power:
4
5 raised to the power 4 is:625
echo "Enter the number:"
read num
echo "Enter the power:"
read pow
rs=$(echo "$num ^ $pow"|bc)
echo "$num raised to the power $pow is:$rs"
OUTPUT
Enter the number:
5
Enter the power:
4
5 raised to the power 4 is:625
Post a Comment
0 Comments