The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Area
By Guest on 22nd March 2024 03:53:02 AM | Syntax: PYTHON | Views: 63



New Paste New paste | Download Paste Download | Toggle Line Numbers Show/Hide line no. | Copy Paste Copy text to clipboard
  1. #!/bin/bash
  2. echo "enter your choice:"
  3. echo "1.area of circle"
  4. echo "2.area of rectangle"
  5. read op
  6. case $op in
  7. 1)
  8.         echo "enter the radius:"
  9.         read r
  10.         op=$(echo "3.14*$r*$r"|bc)
  11.         echo "area of circle is:$op"
  12.         ;;
  13. 2)
  14.         echo " enter the length and breadth"
  15.         read l b
  16.         op=$(echo "$l*$b"|bc)
  17.         echo "area of rectangle is:$op"
  18.         ;;
  19. *)
  20.         echo "invalid operator"
  21. esac





area