Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a script to check whether user enter a value is a
leap year or not?

Answer Posted / subhash chandran

#The logic is that the year is either divisible by both
100 and 4 , OR its only divisible by 4 not by hundred
if($Year%400 == 0 || ($Year%100 != 0 && $Year%4 == 0))
{
print "Leap year \n";
}
else
{
print "Not Leap \n";
}

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does polymorphism work in perl?

968


Explain ivalue?

1051


Why aren't Perl's patterns regular expressions?

1250


How to access parameters passed to a subroutine in perl?

1012


Explain the execution of a program in perl.

1050


Who created perl?

968


Explain the meaning of perl one-liner?

1113


What does delete function do in perl?

1050


Where do we require ‘chomp’ and what does it mean?

1055


What is boolean context?

1053


Explain what is STDIN, STDOUT and STDERR?

1084


What is chomp() operator/function?

1117


What are the various file operations in perl. Explain with example.

1003


How to turn on Perl warnings? Why is that important?

1138


What is the importance of perl warnings?

1226