fork download
  1. #!/bin/bash
  2. echo "enter the length of the rectangle:"
  3. read length
  4. echo "enter the breadth of the rectangle:"
  5. read breadth
  6.  
  7. area=$(echo "$length * $breadth" | bc)
  8. peri=$(echo "2 * ($length + $breadth)" | bc)
  9.  
  10. echo "area of the rectangle:$area"
  11. echo "perimeter of the rectangle:$peri"
Success #stdin #stdout 0.01s 5308KB
stdin
6
2
stdout
enter the length of the rectangle:
enter the breadth of the rectangle:
area of the rectangle:12
perimeter of the rectangle:16