The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Leap
By Guest on 22nd March 2024 05:23:11 AM | Syntax: PYTHON | Views: 81



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 the year to be checked"
  3. read y
  4. a=$((y%400))
  5. z=$((y%100))
  6. d=$((y%4))
  7. if [ $a -eq 0 ]
  8. then
  9.         x="leap year"
  10. elif [ $z -eq 0 ]
  11. then
  12.         x="not leap year"
  13. elif [ $d -eq 0 ]
  14. then
  15.         x="leap year"
  16. else
  17.         x="not leap year"
  18. fi
  19. echo $x





leap