Exercise 2 - Type inferenceExercisesExercise 1 - Leap yearsDocumentation and user's manualTable of contentsOCaml programs

Exercise 1 - Leap years

Recall that a year is leap (or bissextile) if either it is divisible by 4 but not by 100 or it is divisible by 400. For instance 2000 and 2004 are leap years but 1900 and 2006 are not.

Write two functional values that test whether a non-negative year is leap and whose type is  int -> bool :

 1 
  Using  if  but no boolean operator.

 2 
  Using boolean operators but not  if .


Latest update : October 5, 2006
This document was translated from LaTeX by Hyperlatex 2.5, which is not the latest version of Hyperlatex.

Exercise 2 - Type inferenceExercisesExercise 1 - Leap yearsDocumentation and user's manualTable of contentsOCaml programs