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

Why -w argument is used with perl programs?

971


How can you call a subroutine and identify a subroutine?

982


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

929


How to copy a file in perl?

975


Explain what is lvalue?

1014


Explain the difference between declarations of 'my' and 'local' variable scope in perl?

916


What is the use of -n and -p options?

1038


Why do you use Perl?

971


Why is it hard to call this function: sub y { "because" } ?

953


How will you access an element of a perl array?

941


You want to print the contents of an entire array. How would you do that?

954


There are two types of eval statements i.e. Eval expr and eval block. Explain them.

1016


List the prefix dereferencer in Perl.

927


What are some common methods to all handles in perl?

917


What is the use of -w, -t and strict in Perl?

985