Answer to Question #255986 in UNIX/Linux Programming for Kar

Question #255986
Write a script to print either the entered year is a leap year or no. Hint (year%4==0)--- leap else it's not leap year
1
Expert's answer
2021-10-24T11:51:41-0400
read -p "Year: " year

if [[ $(($year % 4)) -eq "0" ]]; then
  echo "It's a leap year!"
else
  echo "It's not a leap year!"
fi

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS