Write a program which tells you:
- how many hours are in a year?
- how many minutes are in a decade?
- how many seconds old are you?
Code:
<?php
echo 24*365, ", ", 60*24*365*10, ", ", (60*60)*((365*32)+(30*8));
?>
Output:
8760, 5256000, 42912000
Harder: If I am 1031 million seconds old, how old am I?
<?php
echo "1,031,000,000 seconds = ", 1031000000/60, " minutes<br>";
echo "or ", 1031000000/(60*60), " hours<br>";
echo "or ", 1031000000/(60*60*24), " days<br>";
echo "or ", 1031000000/(60*60*24*365.25), " years";
?>
Output:
1,031,000,000 seconds = 17183333.333333 minutes
or 286388.88888889 hours
or 11932.87037037 days
or 32.670418536264 years