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

When does circular reference occur?

876


How do you you check the return code of a command in perl?

962


Explain splicing of arrays?

879


What does undef function in perl?

901


How do I sort a hash by the hash value?

885


How do I replace every TAB character in a file with a comma?

940


what are the two ways to get private values inside a subroutine or block?

895


How many data types are there in perl?

924


what is perl language?

900


How will you open a file in a write-only mode in perl?

918


Why Perl aliases are considered to be faster than references?

914


What does init 5 and init 0 do?

977


How to merge two arrays in perl?

1002


What are the arguements we normally use for perl interpreter?

924


List the prefix dereferencer in Perl.

899