Question: We have homework to write bash scripts and I cannot figure out how to do number 2. The homework is as follows: Read http://tldp.org/LDP/abs/html/ops.html 1)
We have homework to write bash scripts and I cannot figure out how to do number 2. The homework is as follows:
Read http://tldp.org/LDP/abs/html/ops.html 1) Copy "Example 8-1. Greatest common divisor" into a file gcd.sh on your BBB. Run the script several times with values of your choosing. 2) Use this script as a prototype for a writing a script to determine if a year is a leap year. A year is a leap year if the year is evenly divisible by 4 unless it is evenly divisible by 100 in which case it is not a leap year unless it is evenly divisible by 400 in which case it is a leap year.
I have no earthly idea how to find a leap year using gcd, much less how to go about coding it. Thanks in advance!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
