Shell Program - to find square and cube of the given number

CODE:

#! /bin/bash

echo "enter a number:"
read a
sq=`expr "$a" \* "$a" `
cube=`expr "$a" \* "$a" \* "$a" `
echo "The square of $a =" $sq
echo "The cube of $a=" $cube


OUTPUT:
Shell Program - to find square and cube of the given number

3 comments :