Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (21 sloc) 604 Bytes
# Leap Year Example
# Asks the user to enter a year and tells them if
# that's a leap year or not.
data:
year is number
divBy4 is number
divBy100 is number
procedure:
display "Enter a year: "
accept year
modulo year by 4 in divBy4
modulo year by 100 in divBy100
if divBy4 is not equal to 0 then
display year " is a common year." lf
else if divBy100 is not equal to 0 then
display year " is a leap year!" lf
else if divBy4 is not equal to 0 or divBy100 is not equal to 0 then
display year " is a common year." lf
else
display year " is a leap year!" lf
end if
You can’t perform that action at this time.