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

Expert's answer

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!

LATEST TUTORIALS
APPROVED BY CLIENTS