- #!/bin/bash
- echo "enter your choice:"
- echo "1.area of circle"
- echo "2.area of rectangle"
- read op
- case $op in
- 1)
- echo "enter the radius:"
- read r
- op=$(echo "3.14*$r*$r"|bc)
- echo "area of circle is:$op"
- ;;
- 2)
- echo " enter the length and breadth"
- read l b
- op=$(echo "$l*$b"|bc)
- echo "area of rectangle is:$op"
- ;;
- *)
- echo "invalid operator"
- esac