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

List the prefix dereferencer in Perl.

877


What is the importance of perl warnings?

1045


what are the steps involved in reading a cgi script on the server?

870


How to read file into hash array ?

1009


What does the’$_’ symbol mean?

946


Which has the highest precedence, List or Terms? Explain?

847


Explain perl. When do you use perl for programming? What are the advantages of programming in perl?

823


How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?

2854


Can you add two arrays together?

860


Mention what is cpan?

950


What is the purpose of redo statement?

947


How will you get the count of parameters passed to a perl subroutine?

882


How do you set environment variables in perl?

972


In Perl, what is grep function used for?

1007


Explain the use of 'my' keyword in perl?

957