C Program to test whether a year is leap year or not
write(*,*)'Enter the year:'
read(*,*)l
if (mod(l,4).ne.0)goto 10
if (mod(l,100).ne.0)goto 20
if (mod(l,400).ne.0)goto 10
20 write(*,*)'The year is a leap year.'
stop
10 write(*,*)'The year is not a leap year.'
stop
end
write(*,*)'Enter the year:'
read(*,*)l
if (mod(l,4).ne.0)goto 10
if (mod(l,100).ne.0)goto 20
if (mod(l,400).ne.0)goto 10
20 write(*,*)'The year is a leap year.'
stop
10 write(*,*)'The year is not a leap year.'
stop
end
Comments
Post a Comment