AREA AND PERIMETER

SOURCE CODE:
echo "Enter the length of the rectangle"
echo "Enter the length of the rectangle"
read l
echo "Enter the breadth of the rectangle"
read b
echo "Enter the side of the square"
read a
areaR=`expr $l \* $b`
periR=`expr $l \* 2 + $b \* 2`
areaS=`expr $a \* $a`
periS=`expr 4 \* $a`
echo "Area of the rectangle = $areaR"
echo "Perimeter of the rectangle = $periR"
echo "Area of the square = $areaS"
echo "Perimeter of the square =$periS"

OUTPUT:
[examuser35@localhost Jebastin]$ sh area.sh
Enter the length of the rectangle
5
Enter the breadth of the rectangle
6
Enter the side of the square
8
Area of the rectangle = 30
Perimeter of the rectangle = 22
Area of the square = 64
Perimeter of the square =32
Previous
Next Post »

If you still didn't find what you're looking for, you can search this website below: