Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

4. Precedence > Answers

Answers

  1. $x = ($x | ($y << 3));

  2. ((($y % 4) == 0) && (($y % 100) != 0)) || (($y % 400) == 0) (This computes whether or not the year $y is a leap year.)

  3. $V = ((4/3)*$PI*($r**3)); (This is the volume of a sphere with radius $r.)

  4. ($x >= 1) || ($x <= 10)

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint