You are on page 1of 3

Problem Solving and Python Programming GE8151

Finding year is leap or not

Algorithm

Step 1 Start Process


Step 2 Read year from user
Step 3 If year % 4 is equal to zero goto Step 5
Step 4 Else goto Step 10
Step 5 If year % 100 is equal to zero goto Step 7
Step 6 Else goto Step 9
Step 7 If year % 400 is equal to zero goto Step 9
Step 8 Else goto Step 10
Step 9 Print year is leap year and goto Step 11
Step 10 Print year is not leap year
Step 11 Stop Process

Rajasekaran S AP/IT
Problem Solving and Python Programming GE8151

Flow Chart

start

read year

False
year % 4 = 0
?
True

year % 100 = 0
?
True
False
False
year % 400 = 0
?
True
Not Leap Year
Leap Year

stop

Rajasekaran S AP/IT
Problem Solving and Python Programming GE8151

Pseudo Code

START
READ year
IF year % 4 is equal to 0
IF year % 100 is equal to 0
IF year % 400 is equal to 0
PRINT “Leap Year”
ELSE
PRINT “Not Leap Year”
END IF
ELSE
PRINT “Leap Year”
END IF
ELSE
PRINT “Not Leap Year”
END IF
STOP

Rajasekaran S AP/IT

You might also like