Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  Question Asked By: Glenn Yemoh   on Aug 08 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Kirtiranjan Sahoo   on Aug 08

#!/bin/bash

read -p "Enter two numbers : " a b
w=`echo $a \* 0.01 | bc`
h=`echo $b \* 0.01 | bc`
area=`echo $w \* $h | bc`
echo "Area of rectangle in square meters : $area"
x=`echo $a \* 0.4 | bc`
y=`echo $b \* 0.4 | bc`
area=`echo $x \* $y | bc`
echo "Area of rectangle in square inches : $area"

Share: