Вы находитесь на странице: 1из 2

Inputs

Year= entering value for year from 1 to 9999


a=True ##boolean expression for help loop to stop after invalid year enter
while not(year>=1 and year<=9999)do{
output (invalid year)
a=False ## boolean expession make loop stop
now break loop ##loop ends here after invalid year
}
if not (a==False)then{
user ask for inputing month
month=entering value for month from 1 to 12

while not(month>=1 and month<=12)do{


output (invalid month)
now break loop
}

if (momth=1)then{
output(month is january 31 days)

if (momth=1)then{
output(month is january 31 days)
}
if (momth=2 and year%4=0 andyear%100 and year%400=0)then{ ## here condition is
that on leap year ferbuary shows 29 days
output(month is ferbuary 29 days)

elif (momth=2)then{
output(month is ferbuary 28 days)

if (momth=3)then{
output(month is march 31 days)
}
if (momth=4)then{
output(month is april 30 days)
}
if (momth=5)then{
output(month is may 31 days)
}
if (momth=6)then{
output(month is june 30 days)
}
if (momth=7)then{
output(month is july 31 days)
}

if (momth=1)then{
output(month is august 31 days)
}
if (momth=1)then{
output(month is september 30 days)
}

if (momth=1)then{
output(month is october 31 days)
}

if (momth=1)then{
output(month is november 30 days)
}
if (momth=1)then{
output(month is december 31 days)
}
if(year%4=0 and year%100=0 and year%400=0)then{ ## checking for whether year
enter is leep or not.
}

Вам также может понравиться